From 3f7d3cef2fc9c02b4b84d3cb9cd9288847f0f653 Mon Sep 17 00:00:00 2001 From: FrozenChen Date: Sat, 4 Sep 2021 18:04:53 -0300 Subject: [PATCH] kurisu.py: Fix reference to specific channels and roles --- kurisu.py | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/kurisu.py b/kurisu.py index 767c77170..c4b1776a9 100644 --- a/kurisu.py +++ b/kurisu.py @@ -178,30 +178,9 @@ def __init__(self, command_prefix, description, commit, branch): 'hardware': None, } - self.assistance_channels = ( - self.channels['3ds-assistance-1'], - self.channels['3ds-assistance-2'], - self.channels['wiiu-assistance'], - self.channels['switch-assistance-1'], - self.channels['switch-assistance-2'], - self.channels['hacking-general'], - self.channels['legacy-systems'], - self.channels['tech-talk'], - self.channels['hardware'], - ) - - self.staff_roles = {'Owner': self.roles['Owner'], - 'SuperOP': self.roles['SuperOP'], - 'OP': self.roles['OP'], - 'HalfOP': self.roles['HalfOP'], - 'Staff': self.roles['Staff'], - } - - self.helper_roles = {"3DS": self.roles['On-Duty 3DS'], - "WiiU": self.roles['On-Duty Wii U'], - "Switch": self.roles['On-Duty Switch'], - "Legacy": self.roles['On-Duty Legacy'] - } + self.helper_roles: dict[str, discord.Role] = {} + self.assistance_channels: tuple[discord.TextChannel] = tuple() + self.staff_roles: dict[str, discord.Role] = {} self.failed_cogs = [] self.channels_not_found = [] @@ -240,6 +219,31 @@ async def on_ready(self): await self.load_channels() await self.load_roles() + self.helper_roles = {"3DS": self.roles['On-Duty 3DS'], + "WiiU": self.roles['On-Duty Wii U'], + "Switch": self.roles['On-Duty Switch'], + "Legacy": self.roles['On-Duty Legacy'] + } + + self.assistance_channels = ( + self.channels['3ds-assistance-1'], + self.channels['3ds-assistance-2'], + self.channels['wiiu-assistance'], + self.channels['switch-assistance-1'], + self.channels['switch-assistance-2'], + self.channels['hacking-general'], + self.channels['legacy-systems'], + self.channels['tech-talk'], + self.channels['hardware'], + ) + + self.staff_roles = {'Owner': self.roles['Owner'], + 'SuperOP': self.roles['SuperOP'], + 'OP': self.roles['OP'], + 'HalfOP': self.roles['HalfOP'], + 'Staff': self.roles['Staff'], + } + self.err_channel = self.channels['bot-err'] startup_message = f'{self.user.name} has started! {self.guild} has {self.guild.member_count:,} members!'