mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
feat(bot): add Interaction.data.type for Command interactions (#2987)
* Add type property to data * Add back type I accidentally removed --------- Co-authored-by: ITOH <to@itoh.at>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type {
|
||||
ApplicationCommandOptionTypes,
|
||||
ApplicationCommandTypes,
|
||||
ChannelTypes,
|
||||
DiscordInteraction,
|
||||
DiscordInteractionDataOption,
|
||||
@@ -38,6 +39,7 @@ export interface Interaction {
|
||||
message?: Message
|
||||
/** the command data payload */
|
||||
data?: {
|
||||
type?: ApplicationCommandTypes
|
||||
componentType?: MessageComponentTypes
|
||||
customId?: string
|
||||
components?: Component[]
|
||||
@@ -79,6 +81,7 @@ export function transformInteraction(bot: Bot, payload: DiscordInteraction): Int
|
||||
if (payload.member && guildId && props.member) interaction.member = bot.transformers.member(bot, payload.member, guildId, user.id)
|
||||
if (payload.data && props.data) {
|
||||
interaction.data = {
|
||||
type: payload.data.type,
|
||||
componentType: payload.data.component_type,
|
||||
customId: payload.data.custom_id,
|
||||
components: payload.data.components?.map((component) => bot.transformers.component(bot, component)),
|
||||
|
||||
Reference in New Issue
Block a user