aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/cheatsheet.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/evergreen/cheatsheet.py')
-rw-r--r--bot/exts/evergreen/cheatsheet.py11
1 files changed, 6 insertions, 5 deletions
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(