diff --git a/src/structures/SlashCommand.js b/src/structures/SlashCommand.js index 13ef1022..8a029515 100644 --- a/src/structures/SlashCommand.js +++ b/src/structures/SlashCommand.js @@ -2,6 +2,9 @@ import Client from "../Client.js"; import { TO_JSON_TYPES_ENUM } from "../constants.js"; import Interaction from "./Interaction.js"; import util from "util"; +import Member from "./Member.js"; +import Role from "./Role.js"; +import cacheChannel from "../util/gluon/cacheChannel.js"; /** * Represents a slash command. @@ -30,6 +33,22 @@ class SlashCommand extends Interaction { * @private */ this.#data = data.data; + + if (data.data.resolved?.members) + for (const [key, value] of Object.entries(data.data.resolved.members)) + new Member(client, value, { + userId: key, + guildId: data.guild_id, + user: data.data.resolved.users[key], + }); + if (data.data.resolved?.roles) + for (const value of Object.values(data.data.resolved.roles)) + new Role(client, value, { + guildId: data.guild_id, + }); + if (data.data.resolved?.channels) + for (const value of Object.values(data.data.resolved.channels)) + cacheChannel(client, value, data.guild_id); } /**