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

Method disableCommand

src/database/sqlite.ts:135–149  ·  view source on GitHub ↗
(guild: string, command: string)

Source from the content-addressed store, hash-verified

133 }
134
135 async disableCommand(guild: string, command: string) {
136 const guildDB = await this.getGuild(guild);
137 this.connection
138 .prepare("UPDATE guilds SET disabled_commands = ? WHERE guild_id = ?")
139 .run(
140 JSON.stringify(
141 (guildDB.disabled_commands ? [...guildDB.disabled_commands, command] : [command]).filter((v) => !!v),
142 ),
143 guild,
144 );
145 disabledCmdCache.set(
146 guild,
147 guildDB.disabled_commands ? [...guildDB.disabled_commands, command] : [command].filter((v) => !!v),
148 );
149 }
150
151 async enableCommand(guild: string, command: string) {
152 const guildDB = await this.getGuild(guild);

Callers 1

runMethod · 0.45

Calls 3

getGuildMethod · 0.95
runMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected