diff --git a/types/src/applications/application.ts b/types/src/applications/application.ts index e2239e93..c7919be0 100644 --- a/types/src/applications/application.ts +++ b/types/src/applications/application.ts @@ -1,5 +1,5 @@ import { UserPayload } from "../users/user.ts"; -import { TeamPayload } from "./team.ts"; +import { TeamPayload } from "../teams/team.ts"; export interface ApplicationPayload { id: string; @@ -22,11 +22,18 @@ export interface ApplicationPayload { cover_image?: string; /** Use it with ApplicationFlags. */ flags?: number; + approximate_guild_count?: number; + redirect_uris?: string[]; + interactions_endpoint_url?: string; tags?: string[]; install_params?: ApplicationInstallParams; custom_install_url?: string; role_connections_verification_url?: string; integration_types?: ApplicationIntegrationType[]; + integration_types_config?: Record< + keyof ApplicationIntegrationType, + ApplicationIntegrationTypeConfig + >; } export enum ApplicationIntegrationType { @@ -34,6 +41,10 @@ export enum ApplicationIntegrationType { USER_INSTALL = 1, } +export interface ApplicationIntegrationTypeConfig { + oauth2_install_params?: ApplicationInstallParams; +} + export interface ApplicationInstallParams { scopes: string[]; permissions: string; @@ -51,3 +62,19 @@ export enum ApplicationFlags { GATEWAY_MESSAGE_CONTENT_LIMITED = 1 << 19, APPLICATION_COMMAND_BADGE = 1 << 23, } + +export interface EditApplicationPayload { + custom_install_url?: string; + description?: string; + role_connections_verification_url?: string; + install_params?: ApplicationInstallParams; + integration_types_config?: Record< + keyof ApplicationIntegrationType, + ApplicationIntegrationTypeConfig + >; + flags?: number; + icon?: string | null; + cover_image?: string | null; + interactions_endpoint_url?: string; + tags?: string[]; +} diff --git a/types/src/applications/mod.ts b/types/src/applications/mod.ts index a05e4b56..a1345ca9 100644 --- a/types/src/applications/mod.ts +++ b/types/src/applications/mod.ts @@ -1,2 +1,2 @@ export * from "./application.ts"; -export * from "./team.ts"; +export * from "./roleConnectionMetadata.ts"; diff --git a/types/src/applications/roleConnectionMetadata.ts b/types/src/applications/roleConnectionMetadata.ts index 96ed2370..3cc4022d 100644 --- a/types/src/applications/roleConnectionMetadata.ts +++ b/types/src/applications/roleConnectionMetadata.ts @@ -4,9 +4,9 @@ export interface ApplicationRoleConnectionMetadata { type: ApplicationRoleConnectionMetadataType; key: string; name: string; - name_localization: Record; + name_localization?: Record; description: string; - description_localization: Record; + description_localization?: Record; } export enum ApplicationRoleConnectionMetadataType { diff --git a/types/src/auditLogs/log.ts b/types/src/auditLogs/log.ts index 3581da78..5388f326 100644 --- a/types/src/auditLogs/log.ts +++ b/types/src/auditLogs/log.ts @@ -1,18 +1,32 @@ import { AutoModerationRulePayload } from "../autoMod/autoMod.ts"; import { OverwritePayload } from "../channels/guild.ts"; -import { GuildThreadChannelPayload } from "../channels/thread.ts"; +import { + GuildThreadChannelPayload, + ThreadMetadataPayload, +} from "../channels/thread.ts"; import { IntegrationPayload } from "../guilds/integration.ts"; +import { GuildPayload } from "../guilds/guild.ts"; import { RolePayload } from "../guilds/role.ts"; -import { ApplicationCommandPayload } from "../interactions/command.ts"; +import { + ApplicationCommandPayload, + ApplicationCommandPermissions, +} from "../interactions/command.ts"; import { ScheduledEventPayload, ScheduledEventPrivacyLevel, ScheduledEventStatus, } from "../scheduledEvent/scheduledEvent.ts"; -import { StagePrivacyLevel } from "../stageInstances/stage.ts"; -import { StickerFormatType } from "../stickers/sticker.ts"; +import { + StageInstancePayload, + StagePrivacyLevel, +} from "../stageInstances/stage.ts"; +import { StickerFormatType, StickerPayload } from "../stickers/sticker.ts"; import { UserPayload } from "../users/user.ts"; import { WebhookPayload } from "../webhooks/webhook.ts"; +import { ChannelPayload } from "../channels/base.ts"; +import { GuildMemberPayload } from "../guilds/member.ts"; +import { InvitePayload } from "../invites/intive.ts"; +import { EmojiPayload } from "../emojis/emoij.ts"; export interface AuditLogPayload { application_commands: ApplicationCommandPayload[]; @@ -90,6 +104,8 @@ export enum AuditLogEvents { AUTO_MODERATION_BLOCK_MESSAGE = 143, AUTO_MODERATION_FLAG_TO_CHANNEL = 144, AUTO_MODERATION_USER_COMMUNICATION_DISABLED = 145, + CREATOR_MONETIZATION_REQUEST_CREATED = 150, + CREATOR_MONETIZATION_TERMS_ACCEPTED = 151, } export interface AuditLogEntryInfoPayload { @@ -104,6 +120,7 @@ export interface AuditLogEntryInfoPayload { message_id?: string; role_name?: string; type?: string; + integration_type?: string; } type AuditLogChangeValue = @@ -115,7 +132,20 @@ type AuditLogChangeValue = | StagePrivacyLevel | ScheduledEventPrivacyLevel | ScheduledEventStatus - | RolePayload; + | RolePayload + | GuildPayload + | ChannelPayload + | GuildMemberPayload + | InvitePayload + | WebhookPayload + | EmojiPayload + | IntegrationPayload + | StageInstancePayload + | StickerPayload + // | GuildScheduledEventPayload + | ThreadMetadataPayload + | ApplicationCommandPermissions + | AutoModerationRulePayload; export interface AuditLogChangePayload { new_value?: AuditLogChangeValue; diff --git a/types/src/autoMod/autoMod.ts b/types/src/autoMod/autoMod.ts index d1a7698c..dc78e976 100644 --- a/types/src/autoMod/autoMod.ts +++ b/types/src/autoMod/autoMod.ts @@ -24,11 +24,12 @@ export enum AutoModerationRuleTriggerType { } export interface AutoModerationRuleTriggerMetadata { - keyword_filter?: string[]; - regex_patterns?: string[]; - presets?: AutoModerationRuleKeywordPreset[]; - allow_list?: string[]; - mention_total_limit?: number; + keyword_filter: string[]; + regex_patterns: string[]; + presets: AutoModerationRuleKeywordPreset[]; + allow_list: string[]; + mention_total_limit: number; + mention_raid_protection_enabled: boolean; } export enum AutoModerationRuleKeywordPreset { @@ -49,8 +50,8 @@ export enum AutoModerationRuleActionType { } export interface AutoModerationRuleActionMetadata { - channel_id?: string; - duration_seconds?: number; + channel_id: string; + duration_seconds: number; custom_message?: string; } diff --git a/types/src/channels/base.ts b/types/src/channels/base.ts index 05a9d31e..718d447a 100644 --- a/types/src/channels/base.ts +++ b/types/src/channels/base.ts @@ -21,7 +21,13 @@ export enum ChannelType { export interface ChannelPayload { id: string; type: ChannelType; - flags: number; + flags?: number; +} + +export enum ChannelFlags { + PINNED = 1 << 1, + REQUIRE_TAG = 1 << 4, + HIDE_MEDIA_DOWNLOAD_OPTIONS = 1 << 15, } export interface TextChannelPayload extends ChannelPayload { diff --git a/types/src/invites/intive.ts b/types/src/invites/invite.ts similarity index 100% rename from types/src/invites/intive.ts rename to types/src/invites/invite.ts diff --git a/types/src/poll/mod.ts b/types/src/poll/mod.ts new file mode 100644 index 00000000..5a49015e --- /dev/null +++ b/types/src/poll/mod.ts @@ -0,0 +1 @@ +export * from "./poll.ts"; diff --git a/types/src/poll/poll.ts b/types/src/poll/poll.ts new file mode 100644 index 00000000..f7c50658 --- /dev/null +++ b/types/src/poll/poll.ts @@ -0,0 +1,53 @@ +import { EmojiPayload } from "../emojis/emoij.ts"; +import { UserPayload } from "../users/user.ts"; + +export interface PollPayload { + question: PollMediaPayload; + answers: PollAnswerPayload[]; + expiry: string | null; + allow_multiselect: boolean; + layout_type: PollLayoutType; + results?: PollResultPayload; +} + +export interface PollCreateRequestPayload { + question: PollMediaPayload; + answers: PollAnswerPayload[]; + expiry: string | null; + allow_multiselect: boolean; + layout_type?: PollLayoutType; +} + +export enum PollLayoutType { + DEFAULT = 1, +} + +export interface PollMediaPayload { + text?: string; + emoji?: EmojiPayload; +} + +export interface PollAnswerPayload { + answer_id: number; + poll_media: PollMediaPayload; +} + +export interface PollResultPayload { + is_finalized: boolean; + answer_counts: PollAnswerCountPayload[]; +} + +export interface PollAnswerCountPayload { + id: number; + count: number; + me_voted: boolean; +} + +export interface GetAnswerVotersParams { + after?: string; + limit?: number; +} + +export interface GetAnswerVotersResponse { + users: UserPayload[]; +} diff --git a/types/src/teams/mod.ts b/types/src/teams/mod.ts new file mode 100644 index 00000000..513bd182 --- /dev/null +++ b/types/src/teams/mod.ts @@ -0,0 +1 @@ +export * from "./team.ts"; diff --git a/types/src/applications/team.ts b/types/src/teams/team.ts similarity index 73% rename from types/src/applications/team.ts rename to types/src/teams/team.ts index 5df151b7..283cf1dd 100644 --- a/types/src/applications/team.ts +++ b/types/src/teams/team.ts @@ -10,12 +10,19 @@ export interface TeamPayload { export interface TeamMemberPayload { membership_state: MembershipState; - permissions: ["*"]; team_id: string; user: UserPayload; + role: string; } export enum MembershipState { INVITED = 1, ACCEPTED = 2, } + +export enum TeamMemberRole { + OWNER = "", + ADMIN = "admin", + DEVELOPER = "developer", + READ_ONLY = "read_only", +}