Example #1
0
 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
Example #2
0
 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
Example #3
0
 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()