diff options
author | 2023-03-12 20:27:28 +0100 | |
---|---|---|
committer | 2023-03-12 20:27:28 +0100 | |
commit | 9367f76221302571175cf0b9209e11f493dcc83d (patch) | |
tree | 19714de1ef594a0137a30e9a6064a7a453c7d25a /botstrap.py | |
parent | add is_forum_channel predicate (diff) |
add necessary workflow to check guild features & act accordingly
Diffstat (limited to 'botstrap.py')
-rw-r--r-- | botstrap.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/botstrap.py b/botstrap.py index caf4459d7..ae8652f4a 100644 --- a/botstrap.py +++ b/botstrap.py @@ -175,6 +175,20 @@ with DiscordClient() as discord_client: config_str += "\n#Channels\n" + if not is_community_server(GUILD_ID, discord_client): + upgrade_server_to_community(GUILD_ID, discord_client) + + create_help_channel = True + if PYTHON_HELP_NAME in all_channels: + python_help_channel_id = all_channels[PYTHON_HELP_NAME] + if not is_forum_channel(python_help_channel_id, discord_client): + delete_channel(python_help_channel_id, discord_client) + else: + create_help_channel = False + + if create_help_channel: + python_help_channel_id = create_forum_channel(PYTHON_HELP_NAME.replace('_', '-'), GUILD_ID, discord_client) + for channel_name in _Channels.__fields__: channel_id = all_channels.get(channel_name, None) if not channel_id: @@ -184,6 +198,7 @@ with DiscordClient() as discord_client: continue config_str += f"channels_{channel_name}={channel_id}\n" + config_str += f"channels_{PYTHON_HELP_NAME}={python_help_channel_id}\n" config_str += "\n#Categories\n" |