aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/evergreen')
-rw-r--r--bot/exts/evergreen/cheatsheet.py12
-rw-r--r--bot/exts/evergreen/conversationstarters.py4
2 files changed, 5 insertions, 11 deletions
diff --git a/bot/exts/evergreen/cheatsheet.py b/bot/exts/evergreen/cheatsheet.py
index a64ddd69..3fe709d5 100644
--- a/bot/exts/evergreen/cheatsheet.py
+++ b/bot/exts/evergreen/cheatsheet.py
@@ -8,8 +8,8 @@ from discord.ext import commands
from discord.ext.commands import BucketType, Context
from bot import constants
-from bot.constants import Categories, Channels, Colours, ERROR_REPLIES, Roles, WHITELISTED_CHANNELS
-from bot.utils.decorators import with_role
+from bot.constants import Categories, Channels, Colours, ERROR_REPLIES
+from bot.utils.decorators import whitelist_override
ERROR_MESSAGE = f"""
Unknown cheat sheet. Please try to reformulate your query.
@@ -75,7 +75,7 @@ class CheatSheet(commands.Cog):
aliases=("cht.sh", "cheatsheet", "cheat-sheet", "cht"),
)
@commands.cooldown(1, 10, BucketType.user)
- @with_role(Roles.everyone_role)
+ @whitelist_override(categories=[Categories.help_in_use])
async def cheat_sheet(self, ctx: Context, *search_terms: str) -> None:
"""
Search cheat.sh.
@@ -84,12 +84,6 @@ class CheatSheet(commands.Cog):
Usage:
--> .cht read json
"""
- if not (
- ctx.channel.category.id == Categories.help_in_use
- or ctx.channel.id in WHITELISTED_CHANNELS
- ):
- return
-
async with ctx.typing():
search_string = quote_plus(" ".join(search_terms))
diff --git a/bot/exts/evergreen/conversationstarters.py b/bot/exts/evergreen/conversationstarters.py
index 576b8d76..e7058961 100644
--- a/bot/exts/evergreen/conversationstarters.py
+++ b/bot/exts/evergreen/conversationstarters.py
@@ -5,7 +5,7 @@ from discord import Color, Embed
from discord.ext import commands
from bot.constants import WHITELISTED_CHANNELS
-from bot.utils.decorators import override_in_channel
+from bot.utils.decorators import whitelist_override
from bot.utils.randomization import RandomCycle
SUGGESTION_FORM = 'https://forms.gle/zw6kkJqv8U43Nfjg9'
@@ -38,7 +38,7 @@ class ConvoStarters(commands.Cog):
self.bot = bot
@commands.command()
- @override_in_channel(ALL_ALLOWED_CHANNELS)
+ @whitelist_override(channels=ALL_ALLOWED_CHANNELS)
async def topic(self, ctx: commands.Context) -> None:
"""
Responds with a random topic to start a conversation.