Skip to content

Commit

Permalink
change soap perms, add soap_check
Browse files Browse the repository at this point in the history
with extra squish
  • Loading branch information
eip618 committed Mar 8, 2024
1 parent 41d141d commit 1dc3184
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cogs/assistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from discord.ext import commands
from os.path import dirname, join
from typing import Optional, Literal, TYPE_CHECKING
from utils.checks import check_if_user_can_sr, is_staff
from utils.checks import check_if_user_can_sr, is_staff, soap_check
from utils.mdcmd import add_md_files_as_commands
from utils.views import BasePaginator, PaginatedEmbedView
from utils.utils import KurisuCooldown
Expand Down 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
11 changes: 11 additions & 0 deletions utils/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ 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):
channel = ctx.channel
Expand Down

0 comments on commit 1dc3184

Please sign in to comment.