From 0b012cb4cee8095afdd455acfeac72a332cbfed0 Mon Sep 17 00:00:00 2001 From: Selyss <99344963+Selyss@users.noreply.github.com> Date: Sun, 17 Dec 2023 14:49:01 -0500 Subject: [PATCH] update --- cogs/inquiry.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cogs/inquiry.py b/cogs/inquiry.py index 406cb28..d7de523 100644 --- a/cogs/inquiry.py +++ b/cogs/inquiry.py @@ -34,14 +34,15 @@ def __init__(self) -> None: custom_id="ticket:inquiry", ) async def open_inquiry(self, btn: nextcord.ui.Button, inter: nextcord.Interaction): - inter.message.author = inter.user - bucket = self.cooldown.get_bucket(inter.message) - retry = bucket.update_rate_limit() - if retry: - return await inter.response.send_message( - f"Slow down! Try again in {int(retry // 3600)}h.", ephemeral=True - ) - await inter.response.send_modal(QuestionForm()) + if isinstance(inter.message, nextcord.Message): + inter.message.author = inter.user + bucket = self.cooldown.get_bucket(inter.message) + retry = bucket.update_rate_limit() + if retry: + return await inter.response.send_message( + f"Slow down! Try again in {int(retry // 3600)}h.", ephemeral=True + ) + await inter.response.send_modal(QuestionForm()) @nextcord.ui.button( label="📢 Advertisement",