File tree Expand file tree Collapse file tree
src/discord_guild_configurator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ def __init__(self, guild: discord.Guild) -> None:
2929 self .guild : Final [discord .Guild ] = guild
3030
3131 async def apply_configuration (self , template : GuildConfig ) -> None :
32+ self ._check_config_compatibility (template )
33+
3234 logger .info ("Configuring roles" )
3335 for role_template in template .roles :
3436 await self .ensure_role (role_template )
@@ -52,6 +54,15 @@ async def apply_configuration(self, template: GuildConfig) -> None:
5254 logger .info ("Configure channel default messages" )
5355 await self .ensure_default_messages (template .categories )
5456
57+ def _check_config_compatibility (self , template : GuildConfig ) -> None :
58+ if (
59+ "COMMUNITY" in self .guild .features
60+ and template .verification_level < discord .VerificationLevel .medium # type: ignore[unsupported-operator]
61+ ):
62+ raise ValueError (
63+ "The Community feature requires a verification level of at least medium"
64+ )
65+
5566 def get_text_channel (self , name : str ) -> discord .TextChannel :
5667 channel = discord_get (self .guild .text_channels , name = name )
5768 if channel is None :
You can’t perform that action at this time.
0 commit comments