From 136bf7ae50934ea2a7b1ed1d4b79933ee9d86332 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Tue, 26 Jul 2022 10:16:27 +0700 Subject: [PATCH] fix(Button + SelectMenu): wrong applicationId #222 --- src/client/Client.js | 6 ++++++ src/structures/Message.js | 2 +- src/structures/MessageButton.js | 2 +- src/structures/MessageSelectMenu.js | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/Client.js b/src/client/Client.js index 5e46967..0f3a443 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -224,6 +224,12 @@ class Client extends BaseClient { */ this.usedCodes = []; + /** + * Session ID + * @type {?string} + */ + this.session_id = null; + if (this.options.messageSweepInterval > 0) { process.emitWarning( 'The message sweeping client options are deprecated, use the global sweepers instead.', diff --git a/src/structures/Message.js b/src/structures/Message.js index 4a29ab6..a66da33 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -1016,7 +1016,7 @@ class Message extends Base { } /** * Click specific button [Suggestion: Dux#2925] - * @param {string} buttonID Button ID + * @param {string} buttonID Button ID * @returns {Promise} */ async clickButton(buttonID) { diff --git a/src/structures/MessageButton.js b/src/structures/MessageButton.js index 5f56ed6..5b2f3db 100644 --- a/src/structures/MessageButton.js +++ b/src/structures/MessageButton.js @@ -180,7 +180,7 @@ class MessageButton extends BaseMessageComponent { guild_id: message.guild?.id ?? null, // In DMs channel_id: message.channel.id, message_id: message.id, - application_id: message.author.id, + application_id: message.applicationId ?? message.author.id, session_id: message.client.session_id, message_flags: message.flags.bitfield, data: { diff --git a/src/structures/MessageSelectMenu.js b/src/structures/MessageSelectMenu.js index 3e329b9..084fb3d 100644 --- a/src/structures/MessageSelectMenu.js +++ b/src/structures/MessageSelectMenu.js @@ -248,7 +248,7 @@ class MessageSelectMenu extends BaseMessageComponent { guild_id: message.guild?.id ?? null, // In DMs channel_id: message.channel.id, message_id: message.id, - application_id: message.author.id, + application_id: message.applicationId ?? message.author.id, session_id: message.client.session_id, message_flags: message.flags.bitfield, data: {