-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Known issues and required features #4
Comments
This could probably be fixed by moving the button-handling system out of Only downside to this is that unfortunately discord doesn't provide a way to delete the original message. You can use I also looked over the code and saw, await action.deferUpdate();
await action.editReply({
content: "Here's your neofetch in mobile mode!",
embeds: [mobileEmbed],
}); this can be simplified to just a |
Thanks a lot of the suggestion @ItzDerock, the discord.js guide/docs didn't have a lot of precise info on how to handle button interactions. I had experienced the errors since I started developing the bot and I had enquired about it to the support server as well, but received no useful information.
await action.deferUpdate();
await action.editReply({
content: "Here's your neofetch in mobile mode!",
embeds: [mobileEmbed],
});
Right, I guess I can do that!
I'm still confused about this and would need a bit more clarification. Is it possible to discuss about this with you in Discord later, if that's alright? |
Currently, looking at the code, every time What I propose is that each button handler is moved into its own interactionCreate event registered to handle all buttons from any embed, rather than how it is right now which is an event per button per interaction. The customId is how the bot will be able to know if the correct user pressed the button. Then you can use This will allow for one event to handle all buttons. And you also won't need to add an expiry/timeout. If you want to talk more on Discord, I'd be down. What's your name#tag? |
Okay, now that does make a lot of sense, I'll try implementing it locally and see if it works I'm guessing this will prevent the
It's |
Without knowing more info about the stack trace of the Unknown Message errors, can't be 100% sure. But I have a strong feeling that this will fix this. Unknown Message can come from trying to edit the reply of an interaction after it has expired. By having the button interaction code in its own file, we are locked to the scope of the button interaction, which has a different expiry than the original interaction, meaning we can't write code that may cause an Unknown Message error to pop up. |
Bot is currently kinda unstable (due to bad code) and needs a few fixes
catch
statements all over the code, which is bad practice reallyprocess.exit()
in the code to move on to the next scriptpino
)If you do know how to fix these issues, please submit a PR, that would be much appreciated.
The text was updated successfully, but these errors were encountered: