aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar shtlrs <[email protected]>2023-03-31 01:52:04 +0200
committerGravatar shtlrs <[email protected]>2023-03-31 01:52:04 +0200
commitdace921097e56dc39d6643f384d1ca08befc9560 (patch)
tree7c8cf7b05cee5f63b2a49e30b3167aaf0821c185
parentintroduce SilencedDict (diff)
bring back the check of python help channel
this also updates the logs in SilencedDict
-rw-r--r--botstrap.py18
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('_', '-')