mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(BaseInteraction): Support new channel payload (#9337)
* feat(BaseInteraction): support new channel payload * refactor(InteractionCreate): different approach Co-Authored-By: Synbulat Biishev <contact@syjalo.dev> --------- Co-authored-by: Synbulat Biishev <contact@syjalo.dev> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -20,7 +20,7 @@ class InteractionCreateAction extends Action {
|
||||
const client = this.client;
|
||||
|
||||
// Resolve and cache partial channels for Interaction#channel getter
|
||||
const channel = this.getChannel(data);
|
||||
const channel = data.channel && this.getChannel(data.channel);
|
||||
|
||||
// Do not emit this for interactions that cache messages that are non-text-based.
|
||||
let InteractionClass;
|
||||
|
||||
@@ -46,7 +46,7 @@ class BaseInteraction extends Base {
|
||||
* The id of the channel this interaction was sent in
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.channelId = data.channel_id ?? null;
|
||||
this.channelId = data.channel?.id ?? null;
|
||||
|
||||
/**
|
||||
* The id of the guild this interaction was sent in
|
||||
|
||||
Reference in New Issue
Block a user