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

Method getCounts

src/database/sqlite.ts:123–133  ·  view source on GitHub ↗
(all?: boolean)

Source from the content-addressed store, hash-verified

121 }
122
123 async getCounts(all?: boolean) {
124 const counts = this.connection.prepare("SELECT * FROM counts").all() as unknown as Count[];
125 const commandNames = [...commands.keys(), ...messageCommands.keys(), ...userCommands.keys()];
126 const countMap = new Map(
127 (all ? counts : counts.filter((val) => commandNames.includes(val.command))).map((val) => [
128 val.command,
129 val.count,
130 ]),
131 );
132 return countMap;
133 }
134
135 async disableCommand(guild: string, command: string) {
136 const guildDB = await this.getGuild(guild);

Callers 3

runMethod · 0.45
runMethod · 0.45
createManageServerFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected