diff options
| author | 2023-03-31 01:52:04 +0200 | |
|---|---|---|
| committer | 2023-03-31 01:52:04 +0200 | |
| commit | dace921097e56dc39d6643f384d1ca08befc9560 (patch) | |
| tree | 7c8cf7b05cee5f63b2a49e30b3167aaf0821c185 /botstrap.py | |
| parent | introduce SilencedDict (diff) | |
bring back the check of python help channel
this also updates the logs in SilencedDict
Diffstat (limited to '')
| -rw-r--r-- | botstrap.py | 18 | 
1 files changed, 11 insertions, 7 deletions
| diff --git a/botstrap.py b/botstrap.py index d36222b83..d3462c122 100644 --- a/botstrap.py +++ b/botstrap.py @@ -52,8 +52,11 @@ class SilencedDict(dict):              super().__getitem__(item)          except KeyError:              log.warning(f"Couldn't find key: {item} in dict: {self.name} ") -            log.warning("Please make sure to use our template: https://discord.new/zmHtscpYN9E3" -                        "to make your own copy of the server to guarantee a successful run of botstrap ") +            log.warning( +                "Please make sure to follow our contribution guideline " +                "https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/bot/ " +                "to guarantee a successful run of botstrap " +            )              sys.exit(-1) @@ -193,11 +196,12 @@ with DiscordClient(guild_id=GUILD_ID) as discord_client:      create_help_channel = True -    python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] -    if not discord_client.is_forum_channel(python_help_channel_id): -        discord_client.delete_channel(python_help_channel_id) -    else: -        create_help_channel = False +    if PYTHON_HELP_CHANNEL_NAME in all_channels: +        python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] +        if not discord_client.is_forum_channel(python_help_channel_id): +            discord_client.delete_channel(python_help_channel_id) +        else: +            create_help_channel = False      if create_help_channel:          python_help_channel_name = PYTHON_HELP_CHANNEL_NAME.replace('_', '-') | 
