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

Method setup

autodel/autodel.ts:45–54  ·  view source on GitHub ↗
(context: { lifecycle: GenerationContext })

Source from the content-addressed store, hash-verified

43 private lifecycle: GenerationContext | null = null;
44
45 async setup(context: { lifecycle: GenerationContext }): Promise<void> {
46 this.lifecycle = context.lifecycle;
47 // Singleton plugin: the constructor's initDatabase() only runs once, but
48 // cleanup() nulls this.db and clears this.settings on every reload. Without
49 // re-initializing here, autodel silently stops working after .reload (db is
50 // null, settings empty) until a full process restart. Re-init on every load.
51 if (!this.db) {
52 await this.initDatabase();
53 }
54 }
55
56 cmdHandlers: Record<string, (msg: Api.Message) => Promise<void>> = {
57 autodel: this.handleAutoDel.bind(this)

Callers

nothing calls this directly

Calls 1

initDatabaseMethod · 0.95

Tested by

no test coverage detected