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

Function saveTask

da/da.ts:74–86  ·  view source on GitHub ↗
(task: DeleteTask)

Source from the content-addressed store, hash-verified

72 await db.read();
73
74 const index = db.data.tasks.findIndex(t => t.chatId === task.chatId);
75 if (index >= 0) {
76 db.data.tasks[index] = task;
77 } else {
78 db.data.tasks.push(task);
79 }
80
81 await db.write();
82};
83
84// 删除任务
85const removeTask = async (chatId: string) => {
86 if (!db) await initDatabase();
87 await db.read();
88
89 db.data.tasks = db.data.tasks.filter(t => t.chatId !== chatId);

Callers 2

fastDeleteBatchFunction · 0.85
daFunction · 0.85

Calls 2

writeMethod · 0.80
initDatabaseFunction · 0.70

Tested by

no test coverage detected