mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
Merge branch 'main' of https://github.com/discordeno/discordeno
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[]
|
||||
@@ -47,7 +49,7 @@ export interface Interaction {
|
||||
options?: InteractionDataOption[]
|
||||
id?: bigint
|
||||
targetId?: bigint
|
||||
guildId?: bigint
|
||||
// guildId?: bigint
|
||||
}
|
||||
/** The selected language of the invoking user */
|
||||
locale?: string
|
||||
@@ -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)),
|
||||
@@ -88,7 +91,7 @@ export function transformInteraction(bot: Bot, payload: DiscordInteraction): Int
|
||||
resolved: payload.data.resolved ? transformInteractionDataResolved(bot, payload.data.resolved, guildId) : undefined,
|
||||
options: payload.data.options?.map((opt) => bot.transformers.interactionDataOptions(bot, opt)),
|
||||
targetId: payload.data.target_id ? bot.transformers.snowflake(payload.data.target_id) : undefined,
|
||||
guildId: payload.data.guild_id ? bot.transformers.snowflake(payload.data.guild_id) : undefined,
|
||||
// guildId: payload.data.guild_id ? bot.transformers.snowflake(payload.data.guild_id) : undefined,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export function createGatewayManager(options: CreateGatewayManagerOptions): Gate
|
||||
totalWorkers: options.totalWorkers ?? 4,
|
||||
shardsPerWorker: options.shardsPerWorker ?? 25,
|
||||
spawnShardDelay: options.spawnShardDelay ?? 5300,
|
||||
preferSnakeCase: false,
|
||||
preferSnakeCase: options.preferSnakeCase ?? false,
|
||||
shards: new Map(),
|
||||
buckets: new Map(),
|
||||
cache: {
|
||||
|
||||
@@ -1805,8 +1805,8 @@ export interface DiscordCreateApplicationCommand {
|
||||
name: string
|
||||
/** Localization object for `name` field. Values follow the same restrictions as `name` */
|
||||
name_localizations?: Localization | null
|
||||
/** Description for `ApplicationCommandTypes.ChatInput` commands, 1-100 characters. Empty string for `ApplicationCommandTypes.User` and `ApplicationCommandTypes.Message` commands */
|
||||
description: string
|
||||
/** Description for `ApplicationCommandTypes.ChatInput` commands, 1-100 characters. */
|
||||
description?: string
|
||||
/** Localization object for `description` field. Values follow the same restrictions as `description` */
|
||||
description_localizations?: Localization | null
|
||||
/** Parameters for the command, max of 25 */
|
||||
|
||||
Reference in New Issue
Block a user