-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(Interactions): option to auto-fetch replies #5831
feat(Interactions): option to auto-fetch replies #5831
Conversation
This needs a rebase. |
29f767c
to
8b365de
Compare
This needs a rebase. |
8b365de
to
3797966
Compare
Rebased |
This needs a rebase. |
3797966
to
2149f8b
Compare
I'm not sure what the benefit of this PR really is. (Probably because I missed the internal discussion about this) We merged and will probably still merge a bunch of PRs making overloads fewer and simpler. const options: InteractionReplyOptions = this.getOptions(); // might have fetchReply, but might not
const maybeMessage = await interaction.reply(options); // option is not assignable to either overload To fix this yet another overload is needed that returns Alternatively to this PR developers could do something like this: (Or anything equivalent to this) const message = await interaction.reply("hello there").then(() => interaction.fetchReply()) |
Yeah @SpaceEEC, fixing Discord not responding with any data is exactly the intention :D I don't really have any strong preference for this feature existing or not - a lot of users are already doing the manual fetching. If it's generally agreed to still not be in line with how the lib should be developed (internal fetches, less overloads etc) lets just close it. |
If we want to keep code and overloads simple, we can simply not merge this PR and tell people to call that method themselves. There are multiple solutions for the issue at hand after all:
If there are more use-cases for this feature, please let me know and maybe we can think of an alternative solution. |
This needs a rebase. |
e65853d
to
6f1e48c
Compare
Stemming from internal discussion, this is one of two opposing PRs which provide a way to automatically fetch the reply/deferral/update to an interaction, assuming it's not ephemeral.
This PR adds an option to the methods, allowing the user to enable auto-fetching. The default maintains the existing behaviour. I've written it such that attempting to auto-fetch an ephemeral reply, or auto-fetch an update to an ephemeral message throws an error - this can be changed of course.
(Testing cross-PR closing) - Closes #5830
Status and versioning classification: