import { Intents, type InteractionTypes } from '@discordeno/types' import type { Bot, CompleteDesiredProperties, DesiredPropertiesBehavior, DiscordInteractionContextType, Guild, Interaction, InteractionData, Member, Message } 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 createBotParameters = { intents: intents.reduce((acc, curr) => acc | curr, Intents.Guilds), desiredProperties: { interaction: { id: true, data: true, type: true, token: true, message: true, channelId: true, channel: true, guildId: true, guild: true, user: true, member: true, }, message: { id: true, member: true, guildId: true, }, }, } as const // Extract the type of desired properties from our parameters type ExtractedDesiredProperties = typeof createBotParameters.desiredProperties // The BotType uses the CompleteDesiredProperties helper to fill in the missing properties export type BotType = Bot, DesiredPropertiesBehavior.RemoveKey> // Type for the interaction reference passed to workflows/activities export interface InteractionRef { id: bigint token: string type: InteractionTypes acknowledged?: boolean /** Id of the application this interaction is for */ applicationId: bigint; /** Guild that the interaction was sent from */ /** The guild it was sent from */ guildId: bigint; /** * The ID of channel it was sent from * * @remarks * It is recommended that you begin using this channel field to identify the source channel of the interaction as they may deprecate the existing channel_id field in the future. */ 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; /** A continuation token for responding to the interaction */ /** Read-only property, always `1` */ version: 1; /** For the message the button was attached to */ messageId?: bigint; locale?: string; /** The guild's preferred locale, if invoked in a guild */ guildLocale?: string; /** The computed permissions for a bot or app in the context of a specific interaction (including channel overwrites) */ appPermissions: bigint; /** Context where the interaction was triggered from */ context?: DiscordInteractionContextType; } // Type for the complete interaction handling payload export interface InteractionCreatePayload { ref: InteractionRef data: Omit }