mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
feat(bot,types): Add webhook events types (#3953)
* Add webhook events types We will not support all the signing part for the handling of http requests, however we do still provide the types for these requests * Apply suggestions from code review Co-authored-by: Awesome Stickz <awesome@stickz.dev> * Use union on DiscordEventWebhookEventBody data --------- Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This commit is contained in:
@@ -66,6 +66,9 @@ export function transformApplication(bot: Bot, payload: { application: DiscordAp
|
||||
: undefined,
|
||||
}
|
||||
: undefined,
|
||||
eventWebhooksUrl: payload.application.event_webhooks_url,
|
||||
eventWebhooksStatus: payload.application.event_webhooks_status,
|
||||
eventWebhooksTypes: payload.application.event_webhooks_types,
|
||||
} as Application
|
||||
|
||||
return bot.transformers.customizers.application(bot, payload.application, application)
|
||||
|
||||
@@ -21,5 +21,8 @@ export function transformApplicationToDiscordApplication(bot: Bot, payload: Appl
|
||||
owner: payload.owner ? bot.transformers.reverse.user(bot, payload.owner) : undefined,
|
||||
team: payload.team ? bot.transformers.reverse.team(bot, payload.team) : null,
|
||||
guild_id: payload.guildId?.toString(),
|
||||
event_webhooks_url: payload.eventWebhooksUrl,
|
||||
event_webhooks_status: payload.eventWebhooksStatus,
|
||||
event_webhooks_types: payload.eventWebhooksTypes,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import type {
|
||||
DefaultMessageNotificationLevels,
|
||||
DiscordActivityInstanceResource,
|
||||
DiscordActivityLocationKind,
|
||||
DiscordApplicationEventWebhookStatus,
|
||||
DiscordApplicationIntegrationType,
|
||||
DiscordAuditLogChange,
|
||||
DiscordAutoModerationRuleTriggerMetadataPresets,
|
||||
@@ -32,6 +33,7 @@ import type {
|
||||
DiscordSkuType,
|
||||
DiscordTeamMemberRole,
|
||||
DiscordTemplateSerializedSourceGuild,
|
||||
DiscordWebhookEventType,
|
||||
EmbedTypes,
|
||||
ExplicitContentFilterLevels,
|
||||
ForumLayout,
|
||||
@@ -175,6 +177,9 @@ export interface Application {
|
||||
integrationTypesConfig?: Partial<Record<DiscordApplicationIntegrationType, ApplicationIntegrationTypeConfiguration>>
|
||||
roleConnectionsVerificationUrl: string
|
||||
tags: string[]
|
||||
eventWebhooksUrl?: string
|
||||
eventWebhooksStatus: DiscordApplicationEventWebhookStatus
|
||||
eventWebhooksTypes?: DiscordWebhookEventType[]
|
||||
}
|
||||
|
||||
export interface ApplicationIntegrationTypeConfiguration {
|
||||
|
||||
Reference in New Issue
Block a user