From dbbf6c2ead964ec539acc4372ed0bbffa8b7bcdd Mon Sep 17 00:00:00 2001 From: FrozenChen Date: Tue, 6 Jun 2023 23:34:53 -0300 Subject: [PATCH] assistance.py: Fix createsmallhelp and createsoap not setting perms correctly --- cogs/assistance.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogs/assistance.py b/cogs/assistance.py index 32328f5a8..7051d3a32 100644 --- a/cogs/assistance.py +++ b/cogs/assistance.py @@ -1,5 +1,6 @@ from __future__ import annotations +import asyncio import discord import logging @@ -133,6 +134,7 @@ async def createsmallhelp(self, ctx: GuildContext, console: Literal['3ds', 'swit # Channel names can't be longer than 100 characters channel_name = f"{console}-{helpee.name}-{desc}"[:100] channel = await self.small_help_category.create_text_channel(name=channel_name) + await asyncio.sleep(1) # Fix for discord race condition(?) await channel.set_permissions(helpee, read_messages=True) await channel.send(f"{helpee.mention}, come here for help.") await self.bot.channels['mod-logs'].send(f"⭕️ **Small help access granted**: {ctx.author.mention} granted access to small help channel to {helpee.mention}") @@ -150,6 +152,7 @@ async def createsoap(self, ctx: GuildContext, helpee: discord.Member): # Channel names can't be longer than 100 characters channel_name = f"3ds-{helpee.name}-soap-🧼"[:100] channel = await self.small_help_category.create_text_channel(name=channel_name) + await asyncio.sleep(1) # Fix for discord race condition(?) await channel.set_permissions(helpee, read_messages=True) await channel.send(f"{helpee.mention}, please read the following.\n" "0. If your console is on, turn it off. If your console happens to already be in GodMode9, skip to step 3.\n"