Listen to button clicks again after server reboot

Hi, I just need a general guidance on how to properly setup an event listener for button clicks after my client/server restarts. I tried the messageReactionAdd event listener but it doesn't work. I also have this but it doesn't work after client reboots as well.
client.on("interactionCreate", async interaction => {
if(interaction.type == InteractionType.ModalSubmit){
console.log(interaction.fields);
}
});
client.on("interactionCreate", async interaction => {
if(interaction.type == InteractionType.ModalSubmit){
console.log(interaction.fields);
}
});
I save the message id on a db but I'm not sure I can respawn it during ready event and make the bot listen for button clicks again.
1 Reply
Kamael愛
Kamael愛OP3y ago
Nevermind, I found my fault.
Want results from more Discord servers?
Add your server