MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / loadExistingSettings

Method loadExistingSettings

autodel/autodel.ts:85–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83 }
84
85 private async loadExistingSettings(): Promise<void> {
86 if (!this.db) return;
87
88 try {
89 const settings = this.db.prepare(
90 "SELECT * FROM autodel_settings"
91 ).all() as { chat_id: string; seconds: number }[];
92
93 for (const setting of settings) {
94 this.settings.set(setting.chat_id, setting.seconds);
95 }
96 } catch (error) {
97 console.error("Failed to load existing settings:", error);
98 }
99 }
100
101 private async handleAutoDel(msg: Api.Message): Promise<void> {
102 const args = msg.message.split(" ").slice(1);

Callers 1

initDatabaseMethod · 0.95

Calls 2

errorMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected