Skip to content

Commit

Permalink
change soap perms, add soap_check
Browse files Browse the repository at this point in the history
  • Loading branch information
eip618 committed Mar 8, 2024
1 parent 41d141d commit ef4c7d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cogs/assistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ async def createsmallhelp(self, ctx: GuildContext, console: Literal['3ds', 'swit
await self.bot.channels['mod-logs'].send(msg)
await ctx.send(f"Created small help {channel.mention}.")

@is_staff('Helper')
@soap_check()
@commands.guild_only()
@commands.command(aliases=["soup", "soap"])
async def createsoap(self, ctx: GuildContext, helpee: discord.Member):
"""Creates a 🧼 help channel for a user. Helper+ only."""
"""Creates a 🧼 help channel for a user. crc, small help, helper+ only."""
if not self.soaps_category:
return await ctx.send("The soaps category is not set.")
# Channel names can't be longer than 100 characters
Expand Down
10 changes: 10 additions & 0 deletions utils/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ async def predicate(ctx):

return commands.check(predicate)

def soap_check():
async def predicate(ctx):
author = ctx.author
if not check_staff(ctx.bot, 'Helper', author.id) and check_staff(ctx.bot, 'Staff', author.id) and (
ctx.bot.roles['crc'] not in author.roles) and (ctx.bot.roles['Small Help'] not in author.roles):
return False
return True

return commands.check(predicate)


def check_if_user_can_ready():
async def predicate(ctx):
Expand Down

0 comments on commit ef4c7d0

Please sign in to comment.