()
| 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); |
no test coverage detected