mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
feat(bot,types)!: Replace userId with User object in interactionMetadata (#3627)
* Replace userId with User object in interactionMetadata * Fix type error --------- Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This commit is contained in:
@@ -366,7 +366,7 @@ export interface Transformers {
|
||||
interactionMetadata: {
|
||||
id: boolean
|
||||
type: boolean
|
||||
userId: boolean
|
||||
user: boolean
|
||||
authorizingIntegrationOwners: boolean
|
||||
originalResponseMessageId: boolean
|
||||
interactedMessageId: boolean
|
||||
@@ -984,7 +984,7 @@ export function createTransformers(options: Partial<Transformers>, opts?: Create
|
||||
interactionMetadata: {
|
||||
id: opts?.defaultDesiredPropertiesValue ?? false,
|
||||
type: opts?.defaultDesiredPropertiesValue ?? false,
|
||||
userId: opts?.defaultDesiredPropertiesValue ?? false,
|
||||
user: opts?.defaultDesiredPropertiesValue ?? false,
|
||||
authorizingIntegrationOwners: opts?.defaultDesiredPropertiesValue ?? false,
|
||||
originalResponseMessageId: opts?.defaultDesiredPropertiesValue ?? false,
|
||||
interactedMessageId: opts?.defaultDesiredPropertiesValue ?? false,
|
||||
|
||||
@@ -417,7 +417,7 @@ export function transformMessageInteractionMetadata(bot: Bot, payload: DiscordMe
|
||||
if (props.triggeringInteractionMetadata && payload.triggering_interaction_metadata)
|
||||
metadata.triggeringInteractionMetadata = transformMessageInteractionMetadata(bot, payload.triggering_interaction_metadata)
|
||||
if (props.type) metadata.type = payload.type
|
||||
if (props.userId) metadata.userId = bot.transformers.snowflake(payload.user_id)
|
||||
if (props.user && payload.user) metadata.user = bot.transformers.user(bot, payload.user)
|
||||
|
||||
return bot.transformers.customizers.messageInteractionMetadata(bot, payload, metadata)
|
||||
}
|
||||
@@ -437,8 +437,8 @@ export interface MessageInteractionMetadata {
|
||||
id: bigint
|
||||
/** The type of interaction */
|
||||
type: InteractionTypes
|
||||
/** ID of the user who triggered the interaction */
|
||||
userId: bigint
|
||||
/** User who triggered the interaction */
|
||||
user: User
|
||||
/** IDs for installation context(s) related to an interaction */
|
||||
authorizingIntegrationOwners: Partial<Record<DiscordApplicationIntegrationType, bigint>>
|
||||
/** ID of the original response message, present only on follow-up messages */
|
||||
|
||||
@@ -1612,8 +1612,8 @@ export interface DiscordMessageInteractionMetadata {
|
||||
id: string
|
||||
/** The type of interaction */
|
||||
type: InteractionTypes
|
||||
/** ID of the user who triggered the interaction */
|
||||
user_id: string
|
||||
/** User who triggered the interaction */
|
||||
user: DiscordUser
|
||||
/** IDs for installation context(s) related to an interaction */
|
||||
authorizing_integration_owners: Partial<Record<DiscordApplicationIntegrationType, string>>
|
||||
/** ID of the original response message, present only on follow-up messages */
|
||||
|
||||
Reference in New Issue
Block a user