(all?: boolean)
| 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); |
no outgoing calls
no test coverage detected