async def reloadCommands(self): for guild in self.bot.guilds: self.commands[guild.id] = dict() for command in CustomCommand.select().where( CustomCommand.serverid == guild.id): self.commands[guild.id][command.trigger] = command.response self.loaded = True
async def reloadCommands(self): while not self.bot.STARTUP_COMPLETE: await asyncio.sleep(1) for guild in self.bot.guilds: self.commands[guild.id] = dict() for command in CustomCommand.select().where( CustomCommand.serverid == guild.id): self.commands[guild.id][command.trigger] = command.response
async def on_guild_remove(self, guild): del self.commands[guild.id] for command in CustomCommand.select().where( CustomCommand.serverid == guild.id): command.delete_instance()