diff --git a/.env.example b/.env.example index 662c4af..effdc93 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,8 @@ BOT_HELP_CHANNEL_ID=7635317444894061557 BOT_MEDIA_CHANNEL_ID=1245859287631622769 -BOT_MOD_ROLE_ID=1245855561015099402 BOT_SHOWCASE_CHANNEL_ID=1245859287634524358 +BOT_MOD_ROLE_ID=1245855561015099402 +BOT_HELPER_ROLE_ID=1245855736495049483 BOT_TOKEN=CdwafxF9MTRvxKKtXpeqKdI4qE.P5PKdC.ke2veU7KdecW5jxgTu-5fgCUssNlPAdNf3tsG7 GITHUB_ORG=ghostty-org GITHUB_REPOS=main:ghostty,bot:discord-bot,web:website diff --git a/app/config.py b/app/config.py index 59a4570..89bd95c 100644 --- a/app/config.py +++ b/app/config.py @@ -14,5 +14,7 @@ HELP_CHANNEL_ID = int(os.environ["BOT_HELP_CHANNEL_ID"]) MEDIA_CHANNEL_ID = int(os.environ["BOT_MEDIA_CHANNEL_ID"]) -MOD_ROLE_ID = int(os.environ["BOT_MOD_ROLE_ID"]) SHOWCASE_CHANNEL_ID = int(os.environ["BOT_SHOWCASE_CHANNEL_ID"]) + +MOD_ROLE_ID = int(os.environ["BOT_MOD_ROLE_ID"]) +HELPER_ROLE_ID = int(os.environ["BOT_HELPER_ROLE_ID"]) diff --git a/app/features/move_message.py b/app/features/move_message.py index 293eb26..612b798 100644 --- a/app/features/move_message.py +++ b/app/features/move_message.py @@ -2,7 +2,7 @@ from app import view from app.setup import bot -from app.utils import SERVER_ONLY, is_dm, is_mod +from app.utils import SERVER_ONLY, is_dm, is_helper, is_mod from app.view import HelpPostTitle @@ -18,7 +18,7 @@ async def move_message( """ assert not is_dm(interaction.user) - if not is_mod(interaction.user): + if not (is_mod(interaction.user) or is_helper(interaction.user)): await interaction.response.send_message( "You do not have permission to move messages.", ephemeral=True ) @@ -43,7 +43,7 @@ async def turn_into_help_post( """ assert not is_dm(interaction.user) - if not is_mod(interaction.user): + if not (is_mod(interaction.user) or is_helper(interaction.user)): await interaction.response.send_message( "You do not have permission to use this action.", ephemeral=True ) diff --git a/app/utils.py b/app/utils.py index 562a195..8c25ec4 100644 --- a/app/utils.py +++ b/app/utils.py @@ -124,6 +124,10 @@ def is_mod(member: discord.Member) -> bool: return member.get_role(config.MOD_ROLE_ID) is not None +def is_helper(member: discord.Member) -> bool: + return member.get_role(config.HELPER_ROLE_ID) is not None + + async def try_dm(account: Account, content: str) -> None: try: await account.send(content)