Skip to content

Commit

Permalink
feat(BaseInteraction): Support new channel payload (#9337)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people committed Apr 16, 2023
1 parent d5e9e36 commit 29389e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js/src/structures/BaseInteraction.js
Expand Up @@ -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
Expand Down

0 comments on commit 29389e3

Please sign in to comment.