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

Method cancelAutoDelSetting

autodel/autodel.ts:179–202  ·  view source on GitHub ↗
(msg: Api.Message, isGlobal: boolean)

Source from the content-addressed store, hash-verified

177 }
178
179 private async cancelAutoDelSetting(msg: Api.Message, isGlobal: boolean): Promise<void> {
180 const chatId = isGlobal ? "0" : msg.peerId.toString();
181
182 if (!this.settings.has(chatId)) {
183 await msg.edit({
184 text: "❌ 未开启自动删除"
185 });
186 return;
187 }
188
189 this.settings.delete(chatId);
190
191 if (this.db) {
192 try {
193 this.db.prepare("DELETE FROM autodel_settings WHERE chat_id = ?").run(chatId);
194 } catch (error) {
195 console.error("Failed to delete setting:", error);
196 }
197 }
198
199 await msg.edit({
200 text: "✅ 取消自动删除任务成功。"
201 });
202 }
203
204 private async setAutoDelSetting(msg: Api.Message, seconds: number, isGlobal: boolean): Promise<void> {
205 const chatId = isGlobal ? "0" : msg.peerId.toString();

Callers 1

handleAutoDelMethod · 0.95

Calls 4

runMethod · 0.80
errorMethod · 0.80
editMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected