diff options
author | 2021-08-24 15:51:45 +0100 | |
---|---|---|
committer | 2021-08-24 16:39:03 +0100 | |
commit | 2c93e2deedddb98efa26e9e513b54df1a457adf6 (patch) | |
tree | 5e6e96175a129d70c5444263700dd5b2f675b344 | |
parent | Add constants.STAFF_PARTNERS_COMMUNITY_ROLES (diff) |
Allow partners & members of the python community to use commands in any channel
Allow partners & members of the python community to use `!remind`, `!help` `!user`, `!snowflake`, `!ping`, `!charinfo` in any channel
-rw-r--r-- | bot/exts/info/help.py | 4 | ||||
-rw-r--r-- | bot/exts/info/information.py | 2 | ||||
-rw-r--r-- | bot/exts/utils/ping.py | 4 | ||||
-rw-r--r-- | bot/exts/utils/reminders.py | 6 | ||||
-rw-r--r-- | bot/exts/utils/utils.py | 6 |
5 files changed, 11 insertions, 11 deletions
diff --git a/bot/exts/info/help.py b/bot/exts/info/help.py index 0235bbaf3..21a6cf752 100644 --- a/bot/exts/info/help.py +++ b/bot/exts/info/help.py @@ -10,7 +10,7 @@ from rapidfuzz import fuzz, process from rapidfuzz.utils import default_process from bot import constants -from bot.constants import Channels, STAFF_ROLES +from bot.constants import Channels, STAFF_PARTNERS_COMMUNITY_ROLES from bot.decorators import redirect_output from bot.pagination import LinePaginator from bot.utils.messages import wait_for_deletion @@ -54,7 +54,7 @@ class CustomHelpCommand(HelpCommand): def __init__(self): super().__init__(command_attrs={"help": "Shows help for bot commands"}) - @redirect_output(destination_channel=Channels.bot_commands, bypass_roles=STAFF_ROLES) + @redirect_output(destination_channel=Channels.bot_commands, bypass_roles=STAFF_PARTNERS_COMMUNITY_ROLES) async def command_callback(self, ctx: Context, *, command: str = None) -> None: """Attempts to match the provided query with a valid command or cog.""" # the only reason we need to tamper with this is because d.py does not support "categories", diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index a9ea403f7..67677a8ad 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -231,7 +231,7 @@ class Information(Cog): return # Will redirect to #bot-commands if it fails. - if in_whitelist_check(ctx, roles=constants.STAFF_ROLES): + if in_whitelist_check(ctx, roles=constants.STAFF_PARTNERS_COMMUNITY_ROLES): embed = await self.create_user_embed(ctx, user) await ctx.send(embed=embed) diff --git a/bot/exts/utils/ping.py b/bot/exts/utils/ping.py index c6d7bd900..cf0e3265e 100644 --- a/bot/exts/utils/ping.py +++ b/bot/exts/utils/ping.py @@ -5,7 +5,7 @@ from discord import Embed from discord.ext import commands from bot.bot import Bot -from bot.constants import Channels, STAFF_ROLES, URLs +from bot.constants import Channels, STAFF_PARTNERS_COMMUNITY_ROLES, URLs from bot.decorators import in_whitelist DESCRIPTIONS = ( @@ -23,7 +23,7 @@ class Latency(commands.Cog): self.bot = bot @commands.command() - @in_whitelist(channels=(Channels.bot_commands,), roles=STAFF_ROLES) + @in_whitelist(channels=(Channels.bot_commands,), roles=STAFF_PARTNERS_COMMUNITY_ROLES) async def ping(self, ctx: commands.Context) -> None: """ Gets different measures of latency within the bot. diff --git a/bot/exts/utils/reminders.py b/bot/exts/utils/reminders.py index 2e60f5030..8aa437895 100644 --- a/bot/exts/utils/reminders.py +++ b/bot/exts/utils/reminders.py @@ -11,7 +11,7 @@ from dateutil.parser import isoparse from discord.ext.commands import Cog, Context, Greedy, group from bot.bot import Bot -from bot.constants import Guild, Icons, MODERATION_ROLES, POSITIVE_REPLIES, Roles, STAFF_ROLES +from bot.constants import Guild, Icons, MODERATION_ROLES, POSITIVE_REPLIES, Roles, STAFF_PARTNERS_COMMUNITY_ROLES, STAFF_ROLES from bot.converters import Duration from bot.pagination import LinePaginator from bot.utils.checks import has_any_role_check, has_no_roles_check @@ -225,8 +225,8 @@ class Reminders(Cog): Expiration is parsed per: http://strftime.org/ """ - # If the user is not staff, we need to verify whether or not to make a reminder at all. - if await has_no_roles_check(ctx, *STAFF_ROLES): + # If the user is not staff, partner or part of the python community, we need to verify whether or not to make a reminder at all. + if await has_no_roles_check(ctx, *STAFF_PARTNERS_COMMUNITY_ROLES): # If they don't have permission to set a reminder in this channel if ctx.channel.id not in WHITELISTED_CHANNELS: diff --git a/bot/exts/utils/utils.py b/bot/exts/utils/utils.py index 98e43c32b..c131213e7 100644 --- a/bot/exts/utils/utils.py +++ b/bot/exts/utils/utils.py @@ -9,7 +9,7 @@ from discord.ext.commands import BadArgument, Cog, Context, clean_content, comma from discord.utils import snowflake_time from bot.bot import Bot -from bot.constants import Channels, MODERATION_ROLES, Roles, STAFF_ROLES +from bot.constants import Channels, MODERATION_ROLES, Roles, STAFF_PARTNERS_COMMUNITY_ROLES, STAFF_ROLES from bot.converters import Snowflake from bot.decorators import in_whitelist from bot.pagination import LinePaginator @@ -50,7 +50,7 @@ class Utils(Cog): self.bot = bot @command() - @in_whitelist(channels=(Channels.bot_commands, Channels.discord_py), roles=STAFF_ROLES) + @in_whitelist(channels=(Channels.bot_commands, Channels.discord_py), roles=STAFF_PARTNERS_COMMUNITY_ROLES) async def charinfo(self, ctx: Context, *, characters: str) -> None: """Shows you information on up to 50 unicode characters.""" match = re.match(r"<(a?):(\w+):(\d+)>", characters) @@ -157,7 +157,7 @@ class Utils(Cog): await ctx.send(embed=embed) @command(aliases=("snf", "snfl", "sf")) - @in_whitelist(channels=(Channels.bot_commands,), roles=STAFF_ROLES) + @in_whitelist(channels=(Channels.bot_commands,), roles=STAFF_PARTNERS_COMMUNITY_ROLES) async def snowflake(self, ctx: Context, *snowflakes: Snowflake) -> None: """Get Discord snowflake creation time.""" if len(snowflakes) > 1 and await has_no_roles_check(ctx, *STAFF_ROLES): |