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:
Jiralite
2023-04-16 15:28:32 +01:00
committed by GitHub
parent d5e9e36e8a
commit 29389e39f4
2 changed files with 2 additions and 2 deletions

View File

@@ -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;

View File

@@ -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