diff options
| -rw-r--r-- | bot/constants.py | 3 | ||||
| -rw-r--r-- | bot/exts/evergreen/cheatsheet.py | 11 | 
2 files changed, 7 insertions, 7 deletions
| diff --git a/bot/constants.py b/bot/constants.py index a070dab3..bb538487 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -243,7 +243,6 @@ class Roles(NamedTuple):      announcements = 463658397560995840      champion = 430492892331769857      contributor = 295488872404484098 -    developer = 352427296948486144      devops = 409416496733880320      jammer = 423054537079783434      moderator = 267629731250176001 @@ -254,7 +253,7 @@ class Roles(NamedTuple):      rockstars = 458226413825294336      core_developers = 587606783669829632      events_lead = 778361735739998228 -    everyone = 267624335836053506 +    everyone_role = 267624335836053506  class Tokens(NamedTuple): diff --git a/bot/exts/evergreen/cheatsheet.py b/bot/exts/evergreen/cheatsheet.py index 83098c76..f650e3b0 100644 --- a/bot/exts/evergreen/cheatsheet.py +++ b/bot/exts/evergreen/cheatsheet.py @@ -3,7 +3,7 @@ import re  import typing as t  from urllib.parse import quote_plus -from discord import Embed, utils +from discord import Embed  from discord.ext import commands  from discord.ext.commands import BucketType, Context @@ -73,7 +73,7 @@ class CheatSheet(commands.Cog):          aliases=("cht.sh", "cheatsheet", "cheat-sheet", "cht"),      )      @commands.cooldown(1, 10, BucketType.user) -    @with_role(Roles.everyone) +    @with_role(Roles.everyone_role)      async def cheat_sheet(self, ctx: Context, *search_terms: str) -> None:          """          Search cheat.sh. @@ -82,9 +82,10 @@ class CheatSheet(commands.Cog):          Usage:          --> .cht read json          """ -        category = utils.get(ctx.message.guild.categories, id=Categories.help_in_use) -        all_allowed_channels = WHITELISTED_CHANNELS + tuple(category.channels) -        if ctx.channel not in all_allowed_channels: +        if not ( +            ctx.channel.category.id == Categories.help_in_use +            or ctx.channel.id in WHITELISTED_CHANNELS +        ):              return          async with self.bot.http_session.get( | 
