#interaction.edit_original_message is so slow the interaction times out, causing a 404
1 messages · Page 1 of 1 (latest)
@button(label="Turn ticket creation on", emoji="\N{ticket}")
async def toggle_ticket_creation(self, _, interaction: discord.Interaction):
self.modify_button(2)
await interaction.edit_original_message(view=self)
old = self.config.supportEnabled
await self.config.update(supportEnabled=not self.config.supportEnabled)
if old:
return await interaction.response.send_message("Ticket creation has been turned off.", ephemeral=True)
else:
return await interaction.response.send_message("Ticket creation has been turned on.", ephemeral=True)
This is the button code
self.modify_button(2) just replaces on with off and vice versa in the button label, so it's not blocking the event loop or anything
you can always defer
doesn't edit_original_message then edit the <bot> is thinking message?
uhh no?
so are you trying to edit the slash command response?
oh ok I thought it did
The message the button is situated on
yes it does
yeah, you can defer it and then send the message
because you are getting a the application did not respond?
I need it to update the original view
literally just changing a button
wow thanks peek good recording
I suppose I could fetch the original message before deferring then doing message.edit(...)
wait I have the context in the view I can just do ctx.edit can't I
yeah
discord should make libraries for us
In a perfect world
and the libraries should accessible for all.