Skip to content

Commit dbbf6c2

Browse files
committedJun 7, 2023
assistance.py: Fix createsmallhelp and createsoap not setting perms correctly
1 parent de0c050 commit dbbf6c2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎cogs/assistance.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import asyncio
34
import discord
45
import logging
56

@@ -133,6 +134,7 @@ async def createsmallhelp(self, ctx: GuildContext, console: Literal['3ds', 'swit
133134
# Channel names can't be longer than 100 characters
134135
channel_name = f"{console}-{helpee.name}-{desc}"[:100]
135136
channel = await self.small_help_category.create_text_channel(name=channel_name)
137+
await asyncio.sleep(1) # Fix for discord race condition(?)
136138
await channel.set_permissions(helpee, read_messages=True)
137139
await channel.send(f"{helpee.mention}, come here for help.")
138140
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):
150152
# Channel names can't be longer than 100 characters
151153
channel_name = f"3ds-{helpee.name}-soap-🧼"[:100]
152154
channel = await self.small_help_category.create_text_channel(name=channel_name)
155+
await asyncio.sleep(1) # Fix for discord race condition(?)
153156
await channel.set_permissions(helpee, read_messages=True)
154157
await channel.send(f"{helpee.mention}, please read the following.\n"
155158
"0. If your console is on, turn it off. If your console happens to already be in GodMode9, skip to step 3.\n"

0 commit comments

Comments
 (0)