* [MODIFIED] Renamed and enhanced to get our own user ID and premium status.
()
| 164 | }, |
| 165 | }; |
| 166 | }; |
| 167 | } |
| 168 | |
| 169 | private async initializeDB() { |
| 170 | const dbPath = path.join(createDirectoryInAssets("trace"), "db.json"); |
| 171 | this.db = await JSONFilePreset<TraceDB>(dbPath, defaultState); |
| 172 | } |
| 173 | |
| 174 | private scheduleDelete(msg: Api.Message, seconds: number): void { |
| 175 | let timer: ReturnType<typeof setTimeout>; |
| 176 | timer = setTimeout(() => { |
| 177 | this.pendingDeleteTimers.delete(timer); |
| 178 | msg.delete().catch(() => {}); |
| 179 | }, seconds * 1000); |
| 180 | if (typeof (timer as any).unref === "function") { |
no outgoing calls
no test coverage detected