Exemple #1
0
    def __init__(self, bot: Bot):
        self.bot = bot
        self.config = SubRedis(bot.db, "events")

        self.errorlog = bot.errorlog

        self.awbw = bot.get_guild(313453805150928906)  # AWBW Guild
        self.channel = bot.get_channel(313453805150928906)  # AWBW General
        self.notifchannel = bot.get_channel(
            637877898560143363)  # BattleMaps-Notifs

        if self.awbw:
            self.sad_andy = get(self.awbw.emojis,
                                id=325608374526017536)  # :sad_andy: emoji
Exemple #2
0
    def __init__(self, bot: Bot):
        self.bot = bot
        self.config = SubRedis(bot.db, "selfroles")

        self.errorlog = bot.errorlog

        self._selfroles = {g.id: [] for g in bot.guilds}

        for key in self.config.scan_iter(match=f"{self.config}:*"):
            guild = bot.get_guild(int(key.split(":")[-1]))
            if not guild:
                continue
            self._selfroles[guild.id] = []
            r_ids = [int(r_id) for r_id in self.config.smembers(key)]
            for role in guild.roles:
                if role.id in r_ids:
                    self._selfroles[guild.id].append(role.id)