diff --git a/cogs/assistance.py b/cogs/assistance.py index 742fd150..40431204 100644 --- a/cogs/assistance.py +++ b/cogs/assistance.py @@ -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 diff --git a/utils/checks.py b/utils/checks.py index 9b60b832..1b633289 100644 --- a/utils/checks.py +++ b/utils/checks.py @@ -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):