pycord get interaction without resending or editing message after restart

Question:

im currently working on a selfroles bot for my server and i got this problem everytim i restart the bot the message with the button to click has to be edited or resend to make the button work again or else it will just say "This interaction failed".

This is the code for my button:

embed = discord.Embed(
    description="Title"
                "Description"
)
requestbutton = discord.ui.Button(
    label="make a request"
)

async def requestcallback(interaction: discord.Interaction):
    modal = RequestModal()
    await interaction.response.send_modal(modal)

requestbutton.callback = requestcallback

view = discord.ui.View()
view.timeout = None

view.add_item(requestbutton)

            
await requestschannel.send(embed=embed, view=view)

Is it possible to get the button to work again after a restart without resending or editing the message?

Asked By: Luca

||

Answers:

Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.