mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 11:20:10 +00:00
Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2627c0c98c | ||
|
|
0c46476110 | ||
|
|
d273000c32 | ||
|
|
5678a63875 | ||
|
|
f9913cb9a1 | ||
|
|
16a6a46832 | ||
|
|
79d9875c5d | ||
|
|
ddb2bde077 | ||
|
|
c8bfdebf24 | ||
|
|
707fd2e36e | ||
|
|
a69286a361 | ||
|
|
c457b8d059 | ||
|
|
7650ce4f72 | ||
|
|
65eebd92d6 | ||
|
|
0fafe5e901 | ||
|
|
0fce829175 | ||
|
|
33d5b14f22 | ||
|
|
aa7d1ee943 | ||
|
|
3e4c34cace | ||
|
|
8c603dc838 | ||
|
|
f9155dddb8 | ||
|
|
d0e4018607 | ||
|
|
189e91d62c | ||
|
|
2eae29d8ca | ||
|
|
2c595f7b20 | ||
|
|
cf4ecedced | ||
|
|
4e37de7f72 | ||
|
|
c9f2c5b020 | ||
|
|
312947de1e | ||
|
|
3ae6d722fd | ||
|
|
fddb2257db | ||
|
|
8de6d6bb4c | ||
|
|
c4ee7907c2 | ||
|
|
02695c5c19 | ||
|
|
fcc48a43e6 | ||
|
|
308d7d40f4 | ||
|
|
1572c2d291 | ||
|
|
a36449a028 | ||
|
|
29d88445e9 | ||
|
|
df3457a520 | ||
|
|
e1653f8f3e | ||
|
|
369d7b712f | ||
|
|
df495ecd20 | ||
|
|
ee7fc06b75 | ||
|
|
c6899314eb | ||
|
|
547d6d118f | ||
|
|
2831452fbd | ||
|
|
3c00105453 | ||
|
|
781f8f198a | ||
|
|
77f5dde20e | ||
|
|
e2b3eb5654 | ||
|
|
46cc9ae288 | ||
|
|
5934e43d01 | ||
|
|
5ae3514498 | ||
|
|
0322478a21 | ||
|
|
33d3806d89 | ||
|
|
aa5f15ed7d | ||
|
|
22b5f47787 | ||
|
|
ddf0a7bdba | ||
|
|
e70fa70526 | ||
|
|
90c70c01bd |
4
.github/workflows/check-deno.yml
vendored
4
.github/workflows/check-deno.yml
vendored
@@ -10,6 +10,10 @@ jobs:
|
||||
check_deno:
|
||||
name: Ensure Deno types are in sync with the code
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v4
|
||||
|
||||
74
CHANGELOG.md
74
CHANGELOG.md
@@ -1,3 +1,77 @@
|
||||
## [0.37.86](https://github.com/discordjs/discord-api-types/compare/0.37.85...0.37.86) (2024-05-27)
|
||||
|
||||
|
||||
|
||||
## [0.37.85](https://github.com/discordjs/discord-api-types/compare/0.37.84...0.37.85) (2024-05-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add gateway events payload for super reactions ([#878](https://github.com/discordjs/discord-api-types/issues/878)) ([16a6a46](https://github.com/discordjs/discord-api-types/commit/16a6a4683204cbf101372a233e235ebf6cb4df4e))
|
||||
* add type query param for get reactions endpoint ([#879](https://github.com/discordjs/discord-api-types/issues/879)) ([ddb2bde](https://github.com/discordjs/discord-api-types/commit/ddb2bde07776f0b9f370ab8ff6bf5c95be0138fd))
|
||||
* **APIMessage:** add `call` ([#983](https://github.com/discordjs/discord-api-types/issues/983)) ([79d9875](https://github.com/discordjs/discord-api-types/commit/79d9875c5d480b4ff4817edfecb58cd5c19c0d7b))
|
||||
|
||||
|
||||
|
||||
## [0.37.84](https://github.com/discordjs/discord-api-types/compare/0.37.83...0.37.84) (2024-05-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **RESTJSONErrorCodes:** add error code 40333 ([#854](https://github.com/discordjs/discord-api-types/issues/854)) ([65eebd9](https://github.com/discordjs/discord-api-types/commit/65eebd92d636d4ea8e3319c8df84208f1d6ce94f))
|
||||
* support avatar decorations ([#834](https://github.com/discordjs/discord-api-types/issues/834)) ([7650ce4](https://github.com/discordjs/discord-api-types/commit/7650ce4f7244c04f30e31938965e5023aa858945))
|
||||
* user-installable apps ([#921](https://github.com/discordjs/discord-api-types/issues/921)) ([c457b8d](https://github.com/discordjs/discord-api-types/commit/c457b8d0596561fd1122e1d96bd168b322de368e))
|
||||
|
||||
|
||||
|
||||
## [0.37.83](https://github.com/discordjs/discord-api-types/compare/0.37.82...0.37.83) (2024-04-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAuditLogChange:** add missing keys ([#964](https://github.com/discordjs/discord-api-types/issues/964)) ([4e37de7](https://github.com/discordjs/discord-api-types/commit/4e37de7f72ad6b9502d3e3db97b10910d9970a92))
|
||||
* one time premium app purchases ([#966](https://github.com/discordjs/discord-api-types/issues/966)) ([c9f2c5b](https://github.com/discordjs/discord-api-types/commit/c9f2c5b020b4c7a36330fe06463106e9cfd38fca))
|
||||
|
||||
|
||||
|
||||
## [0.37.82](https://github.com/discordjs/discord-api-types/compare/0.37.81...0.37.82) (2024-04-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIInvite:** add `type` ([#858](https://github.com/discordjs/discord-api-types/issues/858)) ([c4ee790](https://github.com/discordjs/discord-api-types/commit/c4ee7907c2acf334e898862ed3d7d468dbdaaf5f))
|
||||
* **AuditLogEvent:** onboarding events ([#795](https://github.com/discordjs/discord-api-types/issues/795)) ([fddb225](https://github.com/discordjs/discord-api-types/commit/fddb2257db7aac29129ec5d941c46fba167e2de8))
|
||||
* **ConnectionService:** add `domain` ([#818](https://github.com/discordjs/discord-api-types/issues/818)) ([3ae6d72](https://github.com/discordjs/discord-api-types/commit/3ae6d722fd0b5aa18eb932a51172bba144c2d4ff))
|
||||
|
||||
|
||||
|
||||
## [0.37.81](https://github.com/discordjs/discord-api-types/compare/0.37.80...0.37.81) (2024-04-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Polls:** correct APIPollAnswer properties ([#962](https://github.com/discordjs/discord-api-types/issues/962)) ([308d7d4](https://github.com/discordjs/discord-api-types/commit/308d7d40f45b7e3e78a6b13350d3ad7c8fd81b47))
|
||||
|
||||
|
||||
|
||||
## [0.37.80](https://github.com/discordjs/discord-api-types/compare/0.37.79...0.37.80) (2024-04-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for polls ([#925](https://github.com/discordjs/discord-api-types/issues/925)) ([a36449a](https://github.com/discordjs/discord-api-types/commit/a36449a0283b733c59f5fdc0d6c3f2f786f0514d))
|
||||
|
||||
|
||||
|
||||
## [0.37.79](https://github.com/discordjs/discord-api-types/compare/0.37.78...0.37.79) (2024-04-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ConnectionService:** add bungie connection ([#907](https://github.com/discordjs/discord-api-types/issues/907)) ([22b5f47](https://github.com/discordjs/discord-api-types/commit/22b5f4778778baec7f414c4b253e96b0949de948))
|
||||
|
||||
|
||||
|
||||
## [0.37.78](https://github.com/discordjs/discord-api-types/compare/0.37.77...0.37.78) (2024-04-01)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,77 @@
|
||||
## [0.37.86](https://github.com/discordjs/discord-api-types/compare/0.37.85...0.37.86) (2024-05-27)
|
||||
|
||||
|
||||
|
||||
## [0.37.85](https://github.com/discordjs/discord-api-types/compare/0.37.84...0.37.85) (2024-05-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add gateway events payload for super reactions ([#878](https://github.com/discordjs/discord-api-types/issues/878)) ([16a6a46](https://github.com/discordjs/discord-api-types/commit/16a6a4683204cbf101372a233e235ebf6cb4df4e))
|
||||
* add type query param for get reactions endpoint ([#879](https://github.com/discordjs/discord-api-types/issues/879)) ([ddb2bde](https://github.com/discordjs/discord-api-types/commit/ddb2bde07776f0b9f370ab8ff6bf5c95be0138fd))
|
||||
* **APIMessage:** add `call` ([#983](https://github.com/discordjs/discord-api-types/issues/983)) ([79d9875](https://github.com/discordjs/discord-api-types/commit/79d9875c5d480b4ff4817edfecb58cd5c19c0d7b))
|
||||
|
||||
|
||||
|
||||
## [0.37.84](https://github.com/discordjs/discord-api-types/compare/0.37.83...0.37.84) (2024-05-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **RESTJSONErrorCodes:** add error code 40333 ([#854](https://github.com/discordjs/discord-api-types/issues/854)) ([65eebd9](https://github.com/discordjs/discord-api-types/commit/65eebd92d636d4ea8e3319c8df84208f1d6ce94f))
|
||||
* support avatar decorations ([#834](https://github.com/discordjs/discord-api-types/issues/834)) ([7650ce4](https://github.com/discordjs/discord-api-types/commit/7650ce4f7244c04f30e31938965e5023aa858945))
|
||||
* user-installable apps ([#921](https://github.com/discordjs/discord-api-types/issues/921)) ([c457b8d](https://github.com/discordjs/discord-api-types/commit/c457b8d0596561fd1122e1d96bd168b322de368e))
|
||||
|
||||
|
||||
|
||||
## [0.37.83](https://github.com/discordjs/discord-api-types/compare/0.37.82...0.37.83) (2024-04-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAuditLogChange:** add missing keys ([#964](https://github.com/discordjs/discord-api-types/issues/964)) ([4e37de7](https://github.com/discordjs/discord-api-types/commit/4e37de7f72ad6b9502d3e3db97b10910d9970a92))
|
||||
* one time premium app purchases ([#966](https://github.com/discordjs/discord-api-types/issues/966)) ([c9f2c5b](https://github.com/discordjs/discord-api-types/commit/c9f2c5b020b4c7a36330fe06463106e9cfd38fca))
|
||||
|
||||
|
||||
|
||||
## [0.37.82](https://github.com/discordjs/discord-api-types/compare/0.37.81...0.37.82) (2024-04-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIInvite:** add `type` ([#858](https://github.com/discordjs/discord-api-types/issues/858)) ([c4ee790](https://github.com/discordjs/discord-api-types/commit/c4ee7907c2acf334e898862ed3d7d468dbdaaf5f))
|
||||
* **AuditLogEvent:** onboarding events ([#795](https://github.com/discordjs/discord-api-types/issues/795)) ([fddb225](https://github.com/discordjs/discord-api-types/commit/fddb2257db7aac29129ec5d941c46fba167e2de8))
|
||||
* **ConnectionService:** add `domain` ([#818](https://github.com/discordjs/discord-api-types/issues/818)) ([3ae6d72](https://github.com/discordjs/discord-api-types/commit/3ae6d722fd0b5aa18eb932a51172bba144c2d4ff))
|
||||
|
||||
|
||||
|
||||
## [0.37.81](https://github.com/discordjs/discord-api-types/compare/0.37.80...0.37.81) (2024-04-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Polls:** correct APIPollAnswer properties ([#962](https://github.com/discordjs/discord-api-types/issues/962)) ([308d7d4](https://github.com/discordjs/discord-api-types/commit/308d7d40f45b7e3e78a6b13350d3ad7c8fd81b47))
|
||||
|
||||
|
||||
|
||||
## [0.37.80](https://github.com/discordjs/discord-api-types/compare/0.37.79...0.37.80) (2024-04-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for polls ([#925](https://github.com/discordjs/discord-api-types/issues/925)) ([a36449a](https://github.com/discordjs/discord-api-types/commit/a36449a0283b733c59f5fdc0d6c3f2f786f0514d))
|
||||
|
||||
|
||||
|
||||
## [0.37.79](https://github.com/discordjs/discord-api-types/compare/0.37.78...0.37.79) (2024-04-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ConnectionService:** add bungie connection ([#907](https://github.com/discordjs/discord-api-types/issues/907)) ([22b5f47](https://github.com/discordjs/discord-api-types/commit/22b5f4778778baec7f414c4b253e96b0949de948))
|
||||
|
||||
|
||||
|
||||
## [0.37.78](https://github.com/discordjs/discord-api-types/compare/0.37.77...0.37.78) (2024-04-01)
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import type {
|
||||
APIEntitlement,
|
||||
ChannelType,
|
||||
} from '../payloads/v10/mod.ts';
|
||||
import type { ReactionType } from '../rest/v10/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
|
||||
export * from './common.ts';
|
||||
@@ -203,6 +204,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,6 +263,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -328,6 +333,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -1480,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1813,6 +1820,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2120,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
@@ -35,6 +35,7 @@ import type {
|
||||
APIAuditLogEntry,
|
||||
ChannelType,
|
||||
} from '../payloads/v9/mod.ts';
|
||||
import type { ReactionType } from '../rest/v9/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
import type { APIEntitlement } from '../v10.ts';
|
||||
|
||||
@@ -202,6 +203,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,6 +262,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -327,6 +332,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -1479,7 +1486,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1812,6 +1819,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2119,6 +2165,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
@@ -276,6 +276,12 @@ export const PermissionFlagsBits = {
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendVoiceMessages: 1n << 46n,
|
||||
/**
|
||||
* Allows sending polls
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types?: ApplicationIntegrationType[];
|
||||
/**
|
||||
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
contexts?: InteractionContextType[] | null;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v10.ts';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v10.ts';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { ApplicationIntegrationType } from './interactions.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -128,6 +129,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
install_params?: APIApplicationInstallParams;
|
||||
/**
|
||||
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +146,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,12 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +353,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +364,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +378,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -826,6 +836,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
@@ -666,8 +667,16 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*
|
||||
* @deprecated In favor of `interaction_metadata`
|
||||
*/
|
||||
interaction?: APIMessageInteraction;
|
||||
/**
|
||||
@@ -715,6 +724,21 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -859,6 +883,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -668,6 +668,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -90,6 +90,19 @@ export interface APIInvite {
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
/**
|
||||
* The invite type
|
||||
*/
|
||||
type: InviteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-types
|
||||
*/
|
||||
export enum InviteType {
|
||||
Guild,
|
||||
GroupDM,
|
||||
Friend,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './permissions.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
|
||||
@@ -40,16 +40,48 @@ export interface APIEntitlement {
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
/**
|
||||
* For consumable items, whether or not the entitlement has been consumed
|
||||
*/
|
||||
consumed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased by user
|
||||
*/
|
||||
Purchase = 1,
|
||||
/**
|
||||
* Entitlement for Discord Nitro subscription
|
||||
*/
|
||||
PremiumSubscription,
|
||||
/**
|
||||
* Entitlement was gifted by developer
|
||||
*/
|
||||
DeveloperGift,
|
||||
/**
|
||||
* Entitlement was purchased by a dev in application test mode
|
||||
*/
|
||||
TestModePurchase,
|
||||
/**
|
||||
* Entitlement was granted when the SKU was free
|
||||
*/
|
||||
FreePurchase,
|
||||
/**
|
||||
* Entitlement was gifted by another user
|
||||
*/
|
||||
UserGift,
|
||||
/**
|
||||
* Entitlement was claimed by user for free as a Nitro Subscriber
|
||||
*/
|
||||
PremiumPurchase,
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
ApplicationSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +136,14 @@ export enum SKUFlags {
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Durable one-time purchase
|
||||
*/
|
||||
Durable = 2,
|
||||
/**
|
||||
* Consumable one-time purchase
|
||||
*/
|
||||
Consumable = 3,
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
|
||||
107
deno/payloads/v10/poll.ts
Normal file
107
deno/payloads/v10/poll.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/poll
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure
|
||||
*/
|
||||
export interface APIPoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
results?: APIPollResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#layout-type
|
||||
*/
|
||||
export enum PollLayoutType {
|
||||
/**
|
||||
* The, uhm, default layout type
|
||||
*/
|
||||
Default = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure
|
||||
*/
|
||||
export interface APIPollMedia {
|
||||
/**
|
||||
* The text of the field
|
||||
*
|
||||
* The maximum length is `300` for the question, and `55` for any answer
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* The emoji of the field
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
|
||||
*/
|
||||
export interface APIPollResults {
|
||||
/**
|
||||
* Whether the votes have been precisely counted
|
||||
*/
|
||||
is_finalized: boolean;
|
||||
/**
|
||||
* The counts for each answer
|
||||
*/
|
||||
answer_counts: APIPollAnswerCount[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
|
||||
*/
|
||||
export interface APIPollAnswerCount {
|
||||
/**
|
||||
* The `answer_id`
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The number of votes for this answer
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user voted for this answer
|
||||
*/
|
||||
me_voted: boolean;
|
||||
}
|
||||
@@ -45,6 +45,8 @@ export interface APIStageInstance {
|
||||
export enum StageInstancePrivacyLevel {
|
||||
/**
|
||||
* The stage instance is visible publicly, such as on stage discovery
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
|
||||
@@ -87,8 +87,16 @@ export interface APIUser {
|
||||
* The user's avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*
|
||||
* @deprecated Use `avatar_decoration_data` instead
|
||||
*/
|
||||
avatar_decoration?: string | null;
|
||||
/**
|
||||
* The data for the user's avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,6 +274,8 @@ export interface APIConnection {
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -318,3 +328,19 @@ export interface APIApplicationRoleConnection {
|
||||
*/
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
export interface APIAvatarDecorationData {
|
||||
/**
|
||||
* The avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* The id of the avatar decoration's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types?: ApplicationIntegrationType[];
|
||||
/**
|
||||
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
contexts?: InteractionContextType[] | null;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v9.ts';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v9.ts';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { ApplicationIntegrationType } from './interactions.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -128,6 +129,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
install_params?: APIApplicationInstallParams;
|
||||
/**
|
||||
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +146,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,12 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +353,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +364,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +378,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -826,6 +836,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
@@ -658,6 +659,12 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*/
|
||||
@@ -702,6 +709,21 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -846,6 +868,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#followed-channel-object
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -660,6 +660,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -90,6 +90,19 @@ export interface APIInvite {
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
/**
|
||||
* The invite type
|
||||
*/
|
||||
type: InviteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-types
|
||||
*/
|
||||
export enum InviteType {
|
||||
Guild,
|
||||
GroupDM,
|
||||
Friend,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './permissions.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
|
||||
@@ -40,16 +40,48 @@ export interface APIEntitlement {
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
/**
|
||||
* For consumable items, whether or not the entitlement has been consumed
|
||||
*/
|
||||
consumed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased by user
|
||||
*/
|
||||
Purchase = 1,
|
||||
/**
|
||||
* Entitlement for Discord Nitro subscription
|
||||
*/
|
||||
PremiumSubscription,
|
||||
/**
|
||||
* Entitlement was gifted by developer
|
||||
*/
|
||||
DeveloperGift,
|
||||
/**
|
||||
* Entitlement was purchased by a dev in application test mode
|
||||
*/
|
||||
TestModePurchase,
|
||||
/**
|
||||
* Entitlement was granted when the SKU was free
|
||||
*/
|
||||
FreePurchase,
|
||||
/**
|
||||
* Entitlement was gifted by another user
|
||||
*/
|
||||
UserGift,
|
||||
/**
|
||||
* Entitlement was claimed by user for free as a Nitro Subscriber
|
||||
*/
|
||||
PremiumPurchase,
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
ApplicationSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +136,14 @@ export enum SKUFlags {
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Durable one-time purchase
|
||||
*/
|
||||
Durable = 2,
|
||||
/**
|
||||
* Consumable one-time purchase
|
||||
*/
|
||||
Consumable = 3,
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
|
||||
107
deno/payloads/v9/poll.ts
Normal file
107
deno/payloads/v9/poll.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/poll
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure
|
||||
*/
|
||||
export interface APIPoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
results?: APIPollResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#layout-type
|
||||
*/
|
||||
export enum PollLayoutType {
|
||||
/**
|
||||
* The, uhm, default layout type
|
||||
*/
|
||||
Default = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure
|
||||
*/
|
||||
export interface APIPollMedia {
|
||||
/**
|
||||
* The text of the field
|
||||
*
|
||||
* The maximum length is `300` for the question, and `55` for any answer
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* The emoji of the field
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
|
||||
*/
|
||||
export interface APIPollResults {
|
||||
/**
|
||||
* Whether the votes have been precisely counted
|
||||
*/
|
||||
is_finalized: boolean;
|
||||
/**
|
||||
* The counts for each answer
|
||||
*/
|
||||
answer_counts: APIPollAnswerCount[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
|
||||
*/
|
||||
export interface APIPollAnswerCount {
|
||||
/**
|
||||
* The `answer_id`
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The number of votes for this answer
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user voted for this answer
|
||||
*/
|
||||
me_voted: boolean;
|
||||
}
|
||||
@@ -87,8 +87,16 @@ export interface APIUser {
|
||||
* The user's avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*
|
||||
* @deprecated Use `avatar_decoration_data` instead
|
||||
*/
|
||||
avatar_decoration?: string | null;
|
||||
/**
|
||||
* The data for the user's avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,6 +274,8 @@ export interface APIConnection {
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -318,3 +328,19 @@ export interface APIApplicationRoleConnection {
|
||||
*/
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
export interface APIAvatarDecorationData {
|
||||
/**
|
||||
* The avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* The id of the avatar decoration's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
@@ -156,6 +156,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
|
||||
|
||||
CloudflareIsBlockingYourRequest = 40_333,
|
||||
|
||||
MissingAccess = 50_001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
@@ -295,6 +297,14 @@ export enum RESTJSONErrorCodes {
|
||||
CannotUpdateOnboardingWhileBelowRequirements,
|
||||
|
||||
FailedToBanUsers = 500_000,
|
||||
|
||||
PollVotingBlocked = 520_000,
|
||||
PollExpired,
|
||||
InvalidChannelTypeForPollCreation,
|
||||
CannotEditAPollMessage,
|
||||
CannotUseAnEmojiIncludedWithThePoll,
|
||||
|
||||
CannotExpireANonPollMessage = 520_006,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'integration_types_config'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
|
||||
@@ -26,6 +26,7 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
@@ -325,6 +326,10 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
|
||||
*/
|
||||
enforce_nonce?: boolean | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,6 +373,10 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* The reaction type
|
||||
*/
|
||||
type?: ReactionType;
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
@@ -380,6 +389,14 @@ export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions-reaction-types
|
||||
*/
|
||||
export enum ReactionType {
|
||||
Normal,
|
||||
Super,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,11 @@ import type {
|
||||
APIInteractionResponseCallbackData,
|
||||
ApplicationCommandType,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
NonNullableFields,
|
||||
StrictPartial,
|
||||
} from '../../utils/internals.ts';
|
||||
import type {
|
||||
RESTDeleteAPIWebhookWithTokenMessageResult,
|
||||
RESTGetAPIWebhookWithTokenMessageResult,
|
||||
@@ -43,16 +47,21 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
|
||||
Partial<
|
||||
NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
export * from './template.ts';
|
||||
@@ -461,6 +462,22 @@ export const Routes = {
|
||||
return `/guilds/${guildId}/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/polls/{message.id}/answers/{answer_id}`
|
||||
*/
|
||||
pollAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number) {
|
||||
return `/channels/${channelId}/polls/${messageId}/answers/${answerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/polls/{message.id}/expire`
|
||||
*/
|
||||
expirePoll(channelId: Snowflake, messageId: Snowflake) {
|
||||
return `/channels/${channelId}/polls/${messageId}/expire` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/threads`
|
||||
@@ -943,6 +960,14 @@ export const Routes = {
|
||||
guildBulkBan(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/bulk-ban` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -1076,11 +1101,23 @@ export const CDNRoutes = {
|
||||
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*
|
||||
* @deprecated Use {@link CDNRoutes.avatarDecoration} instead.
|
||||
*/
|
||||
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
|
||||
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/avatar-decoration-presets/{avatar_decoration_data_asset}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*/
|
||||
avatarDecoration(avatarDecorationDataAsset: string) {
|
||||
return `/avatar-decoration-presets/${avatarDecorationDataAsset}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
|
||||
|
||||
@@ -83,3 +83,8 @@ export type RESTDeleteAPIEntitlementResult = never;
|
||||
* https://discord.com/developers/docs/monetization/skus#list-skus
|
||||
*/
|
||||
export type RESTGetAPISKUsResult = APISKU[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
|
||||
*/
|
||||
export type RESTPostAPIEntitlementConsumeResult = never;
|
||||
|
||||
47
deno/rest/v10/poll.ts
Normal file
47
deno/rest/v10/poll.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v10.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersResult {
|
||||
/**
|
||||
* Users who voted for this answer
|
||||
*/
|
||||
users: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#expire-poll
|
||||
*/
|
||||
export type RESTPostAPIPollExpireResult = APIMessage;
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
|
||||
import type { RESTAPIAttachment } from './channel.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -154,6 +155,10 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* Array of tag ids to apply to the thread
|
||||
*/
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'integration_types_config'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
|
||||
@@ -26,6 +26,7 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
@@ -333,6 +334,10 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
|
||||
*/
|
||||
enforce_nonce?: boolean | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,6 +381,10 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* The reaction type
|
||||
*/
|
||||
type?: ReactionType;
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
@@ -388,6 +397,14 @@ export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions-reaction-types
|
||||
*/
|
||||
export enum ReactionType {
|
||||
Normal,
|
||||
Super,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,11 @@ import type {
|
||||
APIInteractionResponseCallbackData,
|
||||
ApplicationCommandType,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
NonNullableFields,
|
||||
StrictPartial,
|
||||
} from '../../utils/internals.ts';
|
||||
import type {
|
||||
RESTDeleteAPIWebhookWithTokenMessageResult,
|
||||
RESTGetAPIWebhookWithTokenMessageResult,
|
||||
@@ -43,16 +47,21 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
|
||||
Partial<
|
||||
NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
export * from './template.ts';
|
||||
@@ -461,6 +462,22 @@ export const Routes = {
|
||||
return `/guilds/${guildId}/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/polls/{message.id}/answers/{answer_id}`
|
||||
*/
|
||||
pollAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number) {
|
||||
return `/channels/${channelId}/polls/${messageId}/answers/${answerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/polls/{message.id}/expire`
|
||||
*/
|
||||
expirePoll(channelId: Snowflake, messageId: Snowflake) {
|
||||
return `/channels/${channelId}/polls/${messageId}/expire` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/threads`
|
||||
@@ -952,6 +969,14 @@ export const Routes = {
|
||||
guildBulkBan(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/bulk-ban` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -1085,11 +1110,23 @@ export const CDNRoutes = {
|
||||
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*
|
||||
* @deprecated Use {@link CDNRoutes.avatarDecoration} instead.
|
||||
*/
|
||||
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
|
||||
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/avatar-decoration-presets/{avatar_decoration_data_asset}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*/
|
||||
avatarDecoration(avatarDecorationDataAsset: string) {
|
||||
return `/avatar-decoration-presets/${avatarDecorationDataAsset}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
|
||||
|
||||
@@ -83,3 +83,8 @@ export type RESTDeleteAPIEntitlementResult = never;
|
||||
* https://discord.com/developers/docs/monetization/skus#list-skus
|
||||
*/
|
||||
export type RESTGetAPISKUsResult = APISKU[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
|
||||
*/
|
||||
export type RESTPostAPIEntitlementConsumeResult = never;
|
||||
|
||||
47
deno/rest/v9/poll.ts
Normal file
47
deno/rest/v9/poll.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v9.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersResult {
|
||||
/**
|
||||
* Users who voted for this answer
|
||||
*/
|
||||
users: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#expire-poll
|
||||
*/
|
||||
export type RESTPostAPIPollExpireResult = APIMessage;
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
|
||||
import type { RESTAPIAttachment } from './channel.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -154,6 +155,10 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* Array of tag ids to apply to the thread
|
||||
*/
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,10 @@ export type Nullable<T> = {
|
||||
[P in keyof T]: T[P] | null;
|
||||
};
|
||||
|
||||
export type NonNullableFields<T> = {
|
||||
[P in keyof T]: NonNullable<T[P]>;
|
||||
};
|
||||
|
||||
export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = {
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ?
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
|
||||
@@ -36,6 +36,7 @@ import type {
|
||||
APIEntitlement,
|
||||
ChannelType,
|
||||
} from '../payloads/v10/index';
|
||||
import type { ReactionType } from '../rest/v10/index';
|
||||
import type { Nullable } from '../utils/internals';
|
||||
|
||||
export * from './common';
|
||||
@@ -203,6 +204,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,6 +263,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -328,6 +333,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -1480,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1813,6 +1820,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2120,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
@@ -35,6 +35,7 @@ import type {
|
||||
APIAuditLogEntry,
|
||||
ChannelType,
|
||||
} from '../payloads/v9/index';
|
||||
import type { ReactionType } from '../rest/v9/index';
|
||||
import type { Nullable } from '../utils/internals';
|
||||
import type { APIEntitlement } from '../v10';
|
||||
|
||||
@@ -202,6 +203,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,6 +262,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -327,6 +332,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -1479,7 +1486,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1812,6 +1819,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2119,6 +2165,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
2808
package-lock.json
generated
2808
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.37.78",
|
||||
"version": "0.37.86",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"homepage": "https://discord-api-types.dev",
|
||||
"exports": {
|
||||
@@ -132,7 +132,7 @@
|
||||
"@commitlint/cli": "^19.0.3",
|
||||
"@commitlint/config-angular": "^19.0.3",
|
||||
"@favware/npm-deprecate": "^1.0.7",
|
||||
"@octokit/action": "^6.0.7",
|
||||
"@octokit/action": "^7.0.0",
|
||||
"@octokit/webhooks-types": "^7.3.2",
|
||||
"@sapphire/prettier-config": "^2.0.0",
|
||||
"@types/conventional-recommended-bump": "^9.0.3",
|
||||
|
||||
@@ -276,6 +276,12 @@ export const PermissionFlagsBits = {
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendVoiceMessages: 1n << 46n,
|
||||
/**
|
||||
* Allows sending polls
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types?: ApplicationIntegrationType[];
|
||||
/**
|
||||
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
contexts?: InteractionContextType[] | null;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals';
|
||||
import type { APIRole, LocaleString } from '../../../v10';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v10';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { LocalizationMap } from '../common';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { ApplicationIntegrationType } from './interactions';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APITeam } from './teams';
|
||||
import type { APIUser } from './user';
|
||||
@@ -128,6 +129,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
install_params?: APIApplicationInstallParams;
|
||||
/**
|
||||
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +146,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration';
|
||||
import type { APIChannel, APIOverwrite } from './channel';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,12 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +353,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +364,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +378,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -826,6 +836,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIGuildMember } from './guild';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
@@ -666,8 +667,16 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*
|
||||
* @deprecated In favor of `interaction_metadata`
|
||||
*/
|
||||
interaction?: APIMessageInteraction;
|
||||
/**
|
||||
@@ -715,6 +724,21 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -859,6 +883,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -668,6 +668,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './poll';
|
||||
export * from './permissions';
|
||||
export * from './stageInstance';
|
||||
export * from './sticker';
|
||||
|
||||
@@ -90,6 +90,19 @@ export interface APIInvite {
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
/**
|
||||
* The invite type
|
||||
*/
|
||||
type: InviteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-types
|
||||
*/
|
||||
export enum InviteType {
|
||||
Guild,
|
||||
GroupDM,
|
||||
Friend,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,16 +40,48 @@ export interface APIEntitlement {
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
/**
|
||||
* For consumable items, whether or not the entitlement has been consumed
|
||||
*/
|
||||
consumed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased by user
|
||||
*/
|
||||
Purchase = 1,
|
||||
/**
|
||||
* Entitlement for Discord Nitro subscription
|
||||
*/
|
||||
PremiumSubscription,
|
||||
/**
|
||||
* Entitlement was gifted by developer
|
||||
*/
|
||||
DeveloperGift,
|
||||
/**
|
||||
* Entitlement was purchased by a dev in application test mode
|
||||
*/
|
||||
TestModePurchase,
|
||||
/**
|
||||
* Entitlement was granted when the SKU was free
|
||||
*/
|
||||
FreePurchase,
|
||||
/**
|
||||
* Entitlement was gifted by another user
|
||||
*/
|
||||
UserGift,
|
||||
/**
|
||||
* Entitlement was claimed by user for free as a Nitro Subscriber
|
||||
*/
|
||||
PremiumPurchase,
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
ApplicationSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +136,14 @@ export enum SKUFlags {
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Durable one-time purchase
|
||||
*/
|
||||
Durable = 2,
|
||||
/**
|
||||
* Consumable one-time purchase
|
||||
*/
|
||||
Consumable = 3,
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
|
||||
107
payloads/v10/poll.ts
Normal file
107
payloads/v10/poll.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/poll
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure
|
||||
*/
|
||||
export interface APIPoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
results?: APIPollResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#layout-type
|
||||
*/
|
||||
export enum PollLayoutType {
|
||||
/**
|
||||
* The, uhm, default layout type
|
||||
*/
|
||||
Default = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure
|
||||
*/
|
||||
export interface APIPollMedia {
|
||||
/**
|
||||
* The text of the field
|
||||
*
|
||||
* The maximum length is `300` for the question, and `55` for any answer
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* The emoji of the field
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
|
||||
*/
|
||||
export interface APIPollResults {
|
||||
/**
|
||||
* Whether the votes have been precisely counted
|
||||
*/
|
||||
is_finalized: boolean;
|
||||
/**
|
||||
* The counts for each answer
|
||||
*/
|
||||
answer_counts: APIPollAnswerCount[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
|
||||
*/
|
||||
export interface APIPollAnswerCount {
|
||||
/**
|
||||
* The `answer_id`
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The number of votes for this answer
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user voted for this answer
|
||||
*/
|
||||
me_voted: boolean;
|
||||
}
|
||||
@@ -45,6 +45,8 @@ export interface APIStageInstance {
|
||||
export enum StageInstancePrivacyLevel {
|
||||
/**
|
||||
* The stage instance is visible publicly, such as on stage discovery
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
|
||||
@@ -87,8 +87,16 @@ export interface APIUser {
|
||||
* The user's avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*
|
||||
* @deprecated Use `avatar_decoration_data` instead
|
||||
*/
|
||||
avatar_decoration?: string | null;
|
||||
/**
|
||||
* The data for the user's avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,6 +274,8 @@ export interface APIConnection {
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -318,3 +328,19 @@ export interface APIApplicationRoleConnection {
|
||||
*/
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
export interface APIAvatarDecorationData {
|
||||
/**
|
||||
* The avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* The id of the avatar decoration's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types?: ApplicationIntegrationType[];
|
||||
/**
|
||||
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
contexts?: InteractionContextType[] | null;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals';
|
||||
import type { APIRole, LocaleString } from '../../../v9';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v9';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { LocalizationMap } from '../common';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { ApplicationIntegrationType } from './interactions';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APITeam } from './teams';
|
||||
import type { APIUser } from './user';
|
||||
@@ -128,6 +129,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
install_params?: APIApplicationInstallParams;
|
||||
/**
|
||||
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +146,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration';
|
||||
import type { APIChannel, APIOverwrite } from './channel';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,12 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +353,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +364,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +378,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -826,6 +836,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIGuildMember } from './guild';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
@@ -658,6 +659,12 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*/
|
||||
@@ -702,6 +709,21 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -846,6 +868,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#followed-channel-object
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -660,6 +660,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './poll';
|
||||
export * from './permissions';
|
||||
export * from './stageInstance';
|
||||
export * from './sticker';
|
||||
|
||||
@@ -90,6 +90,19 @@ export interface APIInvite {
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
/**
|
||||
* The invite type
|
||||
*/
|
||||
type: InviteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-types
|
||||
*/
|
||||
export enum InviteType {
|
||||
Guild,
|
||||
GroupDM,
|
||||
Friend,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,16 +40,48 @@ export interface APIEntitlement {
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
/**
|
||||
* For consumable items, whether or not the entitlement has been consumed
|
||||
*/
|
||||
consumed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased by user
|
||||
*/
|
||||
Purchase = 1,
|
||||
/**
|
||||
* Entitlement for Discord Nitro subscription
|
||||
*/
|
||||
PremiumSubscription,
|
||||
/**
|
||||
* Entitlement was gifted by developer
|
||||
*/
|
||||
DeveloperGift,
|
||||
/**
|
||||
* Entitlement was purchased by a dev in application test mode
|
||||
*/
|
||||
TestModePurchase,
|
||||
/**
|
||||
* Entitlement was granted when the SKU was free
|
||||
*/
|
||||
FreePurchase,
|
||||
/**
|
||||
* Entitlement was gifted by another user
|
||||
*/
|
||||
UserGift,
|
||||
/**
|
||||
* Entitlement was claimed by user for free as a Nitro Subscriber
|
||||
*/
|
||||
PremiumPurchase,
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
ApplicationSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +136,14 @@ export enum SKUFlags {
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Durable one-time purchase
|
||||
*/
|
||||
Durable = 2,
|
||||
/**
|
||||
* Consumable one-time purchase
|
||||
*/
|
||||
Consumable = 3,
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
|
||||
107
payloads/v9/poll.ts
Normal file
107
payloads/v9/poll.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/poll
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure
|
||||
*/
|
||||
export interface APIPoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
results?: APIPollResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#layout-type
|
||||
*/
|
||||
export enum PollLayoutType {
|
||||
/**
|
||||
* The, uhm, default layout type
|
||||
*/
|
||||
Default = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure
|
||||
*/
|
||||
export interface APIPollMedia {
|
||||
/**
|
||||
* The text of the field
|
||||
*
|
||||
* The maximum length is `300` for the question, and `55` for any answer
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* The emoji of the field
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
|
||||
*/
|
||||
export interface APIPollResults {
|
||||
/**
|
||||
* Whether the votes have been precisely counted
|
||||
*/
|
||||
is_finalized: boolean;
|
||||
/**
|
||||
* The counts for each answer
|
||||
*/
|
||||
answer_counts: APIPollAnswerCount[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
|
||||
*/
|
||||
export interface APIPollAnswerCount {
|
||||
/**
|
||||
* The `answer_id`
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The number of votes for this answer
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user voted for this answer
|
||||
*/
|
||||
me_voted: boolean;
|
||||
}
|
||||
@@ -87,8 +87,16 @@ export interface APIUser {
|
||||
* The user's avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*
|
||||
* @deprecated Use `avatar_decoration_data` instead
|
||||
*/
|
||||
avatar_decoration?: string | null;
|
||||
/**
|
||||
* The data for the user's avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,6 +274,8 @@ export interface APIConnection {
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -318,3 +328,19 @@ export interface APIApplicationRoleConnection {
|
||||
*/
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
export interface APIAvatarDecorationData {
|
||||
/**
|
||||
* The avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* The id of the avatar decoration's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"semanticCommits": "enabled",
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true,
|
||||
"schedule": ["before 1pm"]
|
||||
"schedule": ["before 1pm every friday"]
|
||||
},
|
||||
"ignorePaths": ["website/"],
|
||||
"packageRules": [
|
||||
@@ -15,5 +15,5 @@
|
||||
"groupSlug": "all-non-major"
|
||||
}
|
||||
],
|
||||
"schedule": ["every weekday"]
|
||||
"schedule": ["before 1pm every friday"]
|
||||
}
|
||||
|
||||
@@ -156,6 +156,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
|
||||
|
||||
CloudflareIsBlockingYourRequest = 40_333,
|
||||
|
||||
MissingAccess = 50_001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
@@ -295,6 +297,14 @@ export enum RESTJSONErrorCodes {
|
||||
CannotUpdateOnboardingWhileBelowRequirements,
|
||||
|
||||
FailedToBanUsers = 500_000,
|
||||
|
||||
PollVotingBlocked = 520_000,
|
||||
PollExpired,
|
||||
InvalidChannelTypeForPollCreation,
|
||||
CannotEditAPollMessage,
|
||||
CannotUseAnEmojiIncludedWithThePoll,
|
||||
|
||||
CannotExpireANonPollMessage = 520_006,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'integration_types_config'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
|
||||
@@ -26,6 +26,7 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
@@ -325,6 +326,10 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
|
||||
*/
|
||||
enforce_nonce?: boolean | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,6 +373,10 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* The reaction type
|
||||
*/
|
||||
type?: ReactionType;
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
@@ -380,6 +389,14 @@ export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions-reaction-types
|
||||
*/
|
||||
export enum ReactionType {
|
||||
Normal,
|
||||
Super,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './poll';
|
||||
export * from './stageInstance';
|
||||
export * from './sticker';
|
||||
export * from './template';
|
||||
@@ -461,6 +462,22 @@ export const Routes = {
|
||||
return `/guilds/${guildId}/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/polls/{message.id}/answers/{answer_id}`
|
||||
*/
|
||||
pollAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number) {
|
||||
return `/channels/${channelId}/polls/${messageId}/answers/${answerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/polls/{message.id}/expire`
|
||||
*/
|
||||
expirePoll(channelId: Snowflake, messageId: Snowflake) {
|
||||
return `/channels/${channelId}/polls/${messageId}/expire` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/threads`
|
||||
@@ -943,6 +960,14 @@ export const Routes = {
|
||||
guildBulkBan(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/bulk-ban` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -1076,11 +1101,23 @@ export const CDNRoutes = {
|
||||
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*
|
||||
* @deprecated Use {@link CDNRoutes.avatarDecoration} instead.
|
||||
*/
|
||||
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
|
||||
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/avatar-decoration-presets/{avatar_decoration_data_asset}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*/
|
||||
avatarDecoration(avatarDecorationDataAsset: string) {
|
||||
return `/avatar-decoration-presets/${avatarDecorationDataAsset}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
|
||||
|
||||
@@ -6,7 +6,11 @@ import type {
|
||||
APIInteractionResponseCallbackData,
|
||||
ApplicationCommandType,
|
||||
} from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
NonNullableFields,
|
||||
StrictPartial,
|
||||
} from '../../utils/internals';
|
||||
import type {
|
||||
RESTDeleteAPIWebhookWithTokenMessageResult,
|
||||
RESTGetAPIWebhookWithTokenMessageResult,
|
||||
@@ -43,16 +47,21 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
|
||||
Partial<
|
||||
NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,3 +83,8 @@ export type RESTDeleteAPIEntitlementResult = never;
|
||||
* https://discord.com/developers/docs/monetization/skus#list-skus
|
||||
*/
|
||||
export type RESTGetAPISKUsResult = APISKU[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
|
||||
*/
|
||||
export type RESTPostAPIEntitlementConsumeResult = never;
|
||||
|
||||
47
rest/v10/poll.ts
Normal file
47
rest/v10/poll.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v10';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersResult {
|
||||
/**
|
||||
* Users who voted for this answer
|
||||
*/
|
||||
users: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#expire-poll
|
||||
*/
|
||||
export type RESTPostAPIPollExpireResult = APIMessage;
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
} from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals';
|
||||
import type { RESTAPIAttachment } from './channel';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -154,6 +155,10 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* Array of tag ids to apply to the thread
|
||||
*/
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'integration_types_config'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
|
||||
@@ -26,6 +26,7 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v9/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
@@ -333,6 +334,10 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
|
||||
*/
|
||||
enforce_nonce?: boolean | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,6 +381,10 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* The reaction type
|
||||
*/
|
||||
type?: ReactionType;
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
@@ -388,6 +397,14 @@ export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions-reaction-types
|
||||
*/
|
||||
export enum ReactionType {
|
||||
Normal,
|
||||
Super,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './poll';
|
||||
export * from './stageInstance';
|
||||
export * from './sticker';
|
||||
export * from './template';
|
||||
@@ -461,6 +462,22 @@ export const Routes = {
|
||||
return `/guilds/${guildId}/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/polls/{message.id}/answers/{answer_id}`
|
||||
*/
|
||||
pollAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number) {
|
||||
return `/channels/${channelId}/polls/${messageId}/answers/${answerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/polls/{message.id}/expire`
|
||||
*/
|
||||
expirePoll(channelId: Snowflake, messageId: Snowflake) {
|
||||
return `/channels/${channelId}/polls/${messageId}/expire` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/threads`
|
||||
@@ -952,6 +969,14 @@ export const Routes = {
|
||||
guildBulkBan(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/bulk-ban` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -1085,11 +1110,23 @@ export const CDNRoutes = {
|
||||
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*
|
||||
* @deprecated Use {@link CDNRoutes.avatarDecoration} instead.
|
||||
*/
|
||||
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
|
||||
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/avatar-decoration-presets/{avatar_decoration_data_asset}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*/
|
||||
avatarDecoration(avatarDecorationDataAsset: string) {
|
||||
return `/avatar-decoration-presets/${avatarDecorationDataAsset}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
|
||||
|
||||
@@ -6,7 +6,11 @@ import type {
|
||||
APIInteractionResponseCallbackData,
|
||||
ApplicationCommandType,
|
||||
} from '../../payloads/v9/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
NonNullableFields,
|
||||
StrictPartial,
|
||||
} from '../../utils/internals';
|
||||
import type {
|
||||
RESTDeleteAPIWebhookWithTokenMessageResult,
|
||||
RESTGetAPIWebhookWithTokenMessageResult,
|
||||
@@ -43,16 +47,21 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
|
||||
Partial<
|
||||
NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,3 +83,8 @@ export type RESTDeleteAPIEntitlementResult = never;
|
||||
* https://discord.com/developers/docs/monetization/skus#list-skus
|
||||
*/
|
||||
export type RESTGetAPISKUsResult = APISKU[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
|
||||
*/
|
||||
export type RESTPostAPIEntitlementConsumeResult = never;
|
||||
|
||||
47
rest/v9/poll.ts
Normal file
47
rest/v9/poll.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v9';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersResult {
|
||||
/**
|
||||
* Users who voted for this answer
|
||||
*/
|
||||
users: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#expire-poll
|
||||
*/
|
||||
export type RESTPostAPIPollExpireResult = APIMessage;
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
} from '../../payloads/v9/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals';
|
||||
import type { RESTAPIAttachment } from './channel';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -154,6 +155,10 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* Array of tag ids to apply to the thread
|
||||
*/
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,10 @@ export type Nullable<T> = {
|
||||
[P in keyof T]: T[P] | null;
|
||||
};
|
||||
|
||||
export type NonNullableFields<T> = {
|
||||
[P in keyof T]: NonNullable<T[P]>;
|
||||
};
|
||||
|
||||
export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = {
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ?
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
|
||||
@@ -48,7 +48,8 @@ document can be used by bots and are _intended_ for usage by bots. This is a har
|
||||
|
||||
Not every single update to the API is valid to be documented here. Our main stance for documentation is that properties
|
||||
must be known and documented on [`Discord's API Documentation repository`](https://github.com/discord/discord-api-docs),
|
||||
must be mentioned in an open pull request or must have received the green light to be used.
|
||||
must be mentioned in an open pull request, must have received the green light to be used, or must be present in the
|
||||
[stable OpenAPI specification](https://github.com/discord/discord-api-spec/blob/main/specs/openapi.json).
|
||||
|
||||
With that aside, there are times where documentation for certain types is not approved/merged by Discord on the grounds
|
||||
that `it isn't helpful for bots` (or similar), but it would actually benefit bot developers to have it documented (one
|
||||
|
||||
12
website/package-lock.json
generated
12
website/package-lock.json
generated
@@ -9290,9 +9290,9 @@
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||
},
|
||||
"node_modules/ejs": {
|
||||
"version": "3.1.8",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz",
|
||||
"integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==",
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
||||
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
||||
"dependencies": {
|
||||
"jake": "^10.8.5"
|
||||
},
|
||||
@@ -27971,9 +27971,9 @@
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||
},
|
||||
"ejs": {
|
||||
"version": "3.1.8",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz",
|
||||
"integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==",
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
||||
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
||||
"requires": {
|
||||
"jake": "^10.8.5"
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -48,7 +48,8 @@ document can be used by bots and are _intended_ for usage by bots. This is a har
|
||||
|
||||
Not every single update to the API is valid to be documented here. Our main stance for documentation is that properties
|
||||
must be known and documented on [`Discord's API Documentation repository`](https://github.com/discord/discord-api-docs),
|
||||
must be mentioned in an open pull request or must have received the green light to be used.
|
||||
must be mentioned in an open pull request, must have received the green light to be used, or must be present in the
|
||||
[stable OpenAPI specification](https://github.com/discord/discord-api-spec/blob/main/specs/openapi.json).
|
||||
|
||||
With that aside, there are times where documentation for certain types is not approved/merged by Discord on the grounds
|
||||
that `it isn't helpful for bots` (or similar), but it would actually benefit bot developers to have it documented (one
|
||||
@@ -1 +1 @@
|
||||
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.37.78"}]
|
||||
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.37.85"}]
|
||||
1
website/versioned_docs/version-0.37.85/api-typedoc.json
Normal file
1
website/versioned_docs/version-0.37.85/api-typedoc.json
Normal file
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
@@ -48,7 +48,8 @@ document can be used by bots and are _intended_ for usage by bots. This is a har
|
||||
|
||||
Not every single update to the API is valid to be documented here. Our main stance for documentation is that properties
|
||||
must be known and documented on [`Discord's API Documentation repository`](https://github.com/discord/discord-api-docs),
|
||||
must be mentioned in an open pull request or must have received the green light to be used.
|
||||
must be mentioned in an open pull request, must have received the green light to be used, or must be present in the
|
||||
[stable OpenAPI specification](https://github.com/discord/discord-api-spec/blob/main/specs/openapi.json).
|
||||
|
||||
With that aside, there are times where documentation for certain types is not approved/merged by Discord on the grounds
|
||||
that `it isn't helpful for bots` (or similar), but it would actually benefit bot developers to have it documented (one
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user