Making interactions persistent after bot restart

I'm using discord.js 14.3, node v18.9.0. I'd like to create a ticketing system where the user can click a button to open a ticket. Ideally, I'd like to have the embed with those buttons pinned in a channel, and for that message to stay there indefinitely. Is there a way to make those buttons still work after the bot is restarted? At the moment, it seems like if the embed is interacted with after the bot is restarted/goes offline, the interaction fails.
8 Replies
d.js docs
d.js docs2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers. Documentation suggestion for @dustbunnythumper:event (event) Client#interactionCreate Emitted when an interaction is created.
t̴humper
t̴humper2y ago
It seems like if I interact with a message that was posted before the bot is restarted, interactionCreate doesn't fire
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
t̴humper
t̴humper2y ago
Let me give it a try, thanks
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
t̴humper
t̴humper2y ago
It actually does look like it's firing, but the interaction fails ThinkEbi ? My code is supposed to edit the message of the embed and populate it with different data when the select menu is changed. It works when the bot hasn't been restarted yet but not after it goes offline/comes back online. Do I need to fetch messages from a cache or something?
t̴humper
t̴humper2y ago
getProfileEmbed is returning a message with an embed/a select component depending on the selection made
t̴humper
t̴humper2y ago
Sorry, forgot to mention that I wanted to use both! Select menu to get some options for the ticket to decide what category it goes in, and then a button to open the ticket. This actually might be the issue-- I had the listener inside another listener sick fixed it, thanks so much!