MCPcopy Create free account
hub / github.com/esmBot/esmBot / setup

Method setup

src/database/sqlite.ts:72–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 }
71
72 async setup() {
73 const existingCommands = (this.connection.prepare("SELECT command FROM counts").all() as { command: string }[]).map(
74 (x) => x.command,
75 );
76 const commandNames = [...commands.keys(), ...messageCommands.keys(), ...userCommands.keys()];
77 for (const command of commandNames) {
78 if (!existingCommands.includes(command)) {
79 this.connection.prepare("INSERT INTO counts (command, count) VALUES (?, ?)").run(command, 0);
80 }
81 }
82 }
83
84 async stop() {
85 this.connection.close();

Callers 1

app.tsFile · 0.45

Calls 1

runMethod · 0.45

Tested by

no test coverage detected