diff options
| -rw-r--r-- | bot/exts/help_channels/_channel.py | 7 | ||||
| -rw-r--r-- | bot/exts/help_channels/_cog.py | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index d4a742000..3dc9e81ef 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -1,5 +1,5 @@ """Contains all logic to handle changes to posts in the help forum.""" - +import asyncio import textwrap import discord @@ -109,6 +109,11 @@ async def help_thread_opened(opened_thread: discord.Thread, *, reopen: bool = Fa await _close_help_thread(opened_thread, _stats.ClosingReason.CLEANUP) return + # Discord sends the open event long before the thread is ready for actions in the API. + # This causes actions such as fetching the message, pinning message, etc to fail. + # We sleep here to try and delay our code enough so the thread is ready in the API. + await asyncio.sleep(2) + await send_opened_post_dm(opened_thread) if opened_thread.starter_message: diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index 50f8416fc..bb2f43c5a 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -119,9 +119,8 @@ class HelpForum(commands.Cog): if thread.parent_id != self.help_forum_channel_id: return - await _channel.help_thread_opened(thread) - await self.post_with_disallowed_title_check(thread) + await _channel.help_thread_opened(thread) @commands.Cog.listener() async def on_thread_update(self, before: discord.Thread, after: discord.Thread) -> None: |