import { Intents, type InteractionTypes } from '@discordeno/types' import type { Bot, CompleteDesiredProperties, DesiredPropertiesBehavior, DiscordInteractionContextType, InteractionData, RecursivePartial, TransformersDesiredProperties } from 'discordeno' export const intents = [ Intents.GuildModeration, Intents.GuildWebhooks, Intents.GuildExpressions, Intents.GuildScheduledEvents, Intents.GuildMessagePolls, Intents.GuildIntegrations, Intents.GuildInvites, Intents.GuildMessageReactions, Intents.GuildPresences, Intents.DirectMessages, Intents.DirectMessageReactions, Intents.GuildMembers, Intents.Guilds, Intents.GuildInvites, Intents.GuildMessages, ] as const export const desiredProperties = { interaction: { id: true, data: true, type: true, token: true, message: true, channelId: true, channel: true, guildId: true, guild: true, user: true, member: true, context: true, }, message: { id: true, member: true, guildId: true, }, } as const satisfies RecursivePartial export type DesiredProperties = typeof desiredProperties export const createBotParameters = { intents: intents.reduce((acc, curr) => acc | curr, Intents.Guilds), desiredProperties, } as const export type BotType = Bot, DesiredPropertiesBehavior.RemoveKey> // Type for the interaction reference passed to workflows/activities export interface InteractionRef { // id of the interaction id: bigint /** A continuation token for responding to the interaction */ token: string type: InteractionTypes acknowledged?: boolean /** The guild it was sent from */ guildId?: bigint; channelId?: bigint; /** Guild member data for the invoking user, including permissions */ memberId?: bigint ; /** User object for the invoking user, if invoked in a DM */ userId?: bigint; /** For the message the button was attached to */ messageId?: bigint; // locale of the interaction locale?: string; /** The guild's preferred locale, if invoked in a guild */ guildLocale?: string; /** Context where the interaction was triggered from */ context?: DiscordInteractionContextType; } // Type for the complete interaction handling payload export interface InteractionCreatePayload { ref: InteractionRef data: Omit }