(context: { lifecycle: GenerationContext })
| 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) |
nothing calls this directly
no test coverage detected