Skip to content

Commit

Permalink
assistance.py: Fix createsmallhelp and createsoap not setting perms c…
Browse files Browse the repository at this point in the history
…orrectly
  • Loading branch information
FrozenChen committed Jun 7, 2023
1 parent de0c050 commit 3fa5e3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cogs/assistance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import asyncio
import discord
import logging

Expand Down Expand Up @@ -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}")
Expand All @@ -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"
Expand Down

0 comments on commit 3fa5e3c

Please sign in to comment.