Skip to content

Commit

Permalink
soap: commands should not be run in DMs
Browse files Browse the repository at this point in the history
  • Loading branch information
lifehackerhansol committed Sep 30, 2024
1 parent ab1da9d commit 60b0aa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cogs/soap.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ def __init__(self, bot: Kurisu):
self.bot.loop.create_task(self.setup_soap())

async def cog_check(self, ctx: GuildContext):
if ctx.guild is None:
raise commands.NoPrivateMessage()
author = ctx.author
if not check_staff(self.bot, 'Helper', author.id) and not check_staff(self.bot, 'Staff', author.id) and (
self.bot.roles['crc'] not in author.roles) and (self.bot.roles['Small Help'] not in author.roles):
raise InsufficientStaffRank("You can't use this command.")
return False
return True

async def setup_soap(self):
Expand Down

0 comments on commit 60b0aa4

Please sign in to comment.