chapterjs 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/asset.d.ts +46 -0
- package/dist/assets/asset.js +86 -0
- package/dist/assets/public.d.ts +19 -0
- package/dist/assets/public.js +120 -0
- package/dist/cache/cache.d.ts +62 -0
- package/dist/cache/cache.js +80 -0
- package/dist/cache/store.d.ts +45 -0
- package/dist/cache/store.js +53 -0
- package/dist/cli/build.d.ts +41 -0
- package/dist/cli/build.js +206 -0
- package/dist/cli/cli.js +108 -25
- package/dist/cli/cluster.d.ts +70 -0
- package/dist/cli/cluster.js +213 -0
- package/dist/cli/dev.d.ts +18 -1
- package/dist/cli/dev.js +252 -198
- package/dist/cli/env.d.ts +31 -0
- package/dist/cli/env.js +93 -0
- package/dist/cli/log.d.ts +13 -0
- package/dist/cli/log.js +17 -0
- package/dist/cli/node-version.d.ts +8 -0
- package/dist/cli/node-version.js +13 -0
- package/dist/cli/preflight.d.ts +36 -0
- package/dist/cli/preflight.js +122 -0
- package/dist/cli/project.d.ts +122 -0
- package/dist/cli/project.js +452 -0
- package/dist/cli/start.d.ts +25 -0
- package/dist/cli/start.js +225 -0
- package/dist/commands/autocomplete.d.ts +13 -0
- package/dist/commands/autocomplete.js +159 -0
- package/dist/commands/command.d.ts +346 -0
- package/dist/commands/command.js +28 -0
- package/dist/commands/convention.d.ts +64 -0
- package/dist/commands/convention.js +464 -0
- package/dist/commands/register.d.ts +18 -0
- package/dist/commands/register.js +42 -0
- package/dist/commands/router.d.ts +20 -0
- package/dist/commands/router.js +228 -0
- package/dist/commands/tree.d.ts +43 -0
- package/dist/commands/tree.js +206 -0
- package/dist/commands/twins.d.ts +15 -0
- package/dist/commands/twins.js +78 -0
- package/dist/components/button.d.ts +79 -0
- package/dist/components/button.js +108 -0
- package/dist/components/component.d.ts +140 -0
- package/dist/components/component.js +39 -0
- package/dist/components/convention.d.ts +35 -0
- package/dist/components/convention.js +339 -0
- package/dist/components/custom-id.d.ts +72 -0
- package/dist/components/custom-id.js +128 -0
- package/dist/components/embed.d.ts +28 -0
- package/dist/components/embed.js +11 -0
- package/dist/components/file.d.ts +30 -0
- package/dist/components/file.js +52 -0
- package/dist/components/instance.d.ts +100 -0
- package/dist/components/instance.js +86 -0
- package/dist/components/layout.d.ts +103 -0
- package/dist/components/layout.js +279 -0
- package/dist/components/modal.d.ts +244 -0
- package/dist/components/modal.js +399 -0
- package/dist/components/options.d.ts +41 -0
- package/dist/components/options.js +101 -0
- package/dist/components/render.d.ts +12 -0
- package/dist/components/render.js +58 -0
- package/dist/components/router.d.ts +18 -0
- package/dist/components/router.js +256 -0
- package/dist/components/select.d.ts +144 -0
- package/dist/components/select.js +179 -0
- package/dist/core/bot.d.ts +99 -0
- package/dist/core/bot.js +174 -0
- package/dist/core/memory.d.ts +66 -0
- package/dist/core/memory.js +115 -0
- package/dist/discord/api.d.ts +112 -0
- package/dist/discord/api.js +115 -0
- package/dist/discord/cdn.d.ts +67 -0
- package/dist/discord/cdn.js +100 -0
- package/dist/discord/codes.d.ts +171 -0
- package/dist/discord/codes.js +421 -0
- package/dist/discord/endpoint.d.ts +56 -0
- package/dist/discord/endpoint.js +53 -0
- package/dist/discord/endpoints.d.ts +1529 -0
- package/dist/discord/endpoints.js +1139 -0
- package/dist/discord/formatting.d.ts +67 -0
- package/dist/discord/formatting.js +87 -0
- package/dist/discord/index.d.ts +10 -0
- package/dist/discord/index.js +13 -0
- package/dist/discord/intents.d.ts +48 -0
- package/dist/discord/intents.js +128 -0
- package/dist/discord/permissions.d.ts +94 -0
- package/dist/discord/permissions.js +185 -0
- package/dist/discord/snowflake.d.ts +21 -0
- package/dist/discord/snowflake.js +36 -0
- package/dist/discord/types/application-command.d.ts +332 -0
- package/dist/discord/types/application-command.js +48 -0
- package/dist/discord/types/application-role-connection-metadata.d.ts +42 -0
- package/dist/discord/types/application-role-connection-metadata.js +22 -0
- package/dist/discord/types/application.d.ts +208 -0
- package/dist/discord/types/application.js +48 -0
- package/dist/discord/types/audit-log.d.ts +255 -0
- package/dist/discord/types/audit-log.js +144 -0
- package/dist/discord/types/auto-moderation.d.ts +167 -0
- package/dist/discord/types/auto-moderation.js +52 -0
- package/dist/discord/types/channel.d.ts +557 -0
- package/dist/discord/types/channel.js +88 -0
- package/dist/discord/types/common.d.ts +54 -0
- package/dist/discord/types/common.js +38 -0
- package/dist/discord/types/component.d.ts +775 -0
- package/dist/discord/types/component.js +76 -0
- package/dist/discord/types/emoji.d.ts +74 -0
- package/dist/discord/types/emoji.js +1 -0
- package/dist/discord/types/entitlement.d.ts +84 -0
- package/dist/discord/types/entitlement.js +22 -0
- package/dist/discord/types/gateway-events.d.ts +1148 -0
- package/dist/discord/types/gateway-events.js +54 -0
- package/dist/discord/types/gateway.d.ts +38 -0
- package/dist/discord/types/gateway.js +1 -0
- package/dist/discord/types/guild-scheduled-event.d.ts +257 -0
- package/dist/discord/types/guild-scheduled-event.js +68 -0
- package/dist/discord/types/guild-template.d.ts +51 -0
- package/dist/discord/types/guild-template.js +1 -0
- package/dist/discord/types/guild.d.ts +910 -0
- package/dist/discord/types/guild.js +153 -0
- package/dist/discord/types/index.d.ts +31 -0
- package/dist/discord/types/index.js +31 -0
- package/dist/discord/types/interaction.d.ts +321 -0
- package/dist/discord/types/interaction.js +47 -0
- package/dist/discord/types/invite.d.ts +158 -0
- package/dist/discord/types/invite.js +39 -0
- package/dist/discord/types/message.d.ts +834 -0
- package/dist/discord/types/message.js +159 -0
- package/dist/discord/types/oauth2.d.ts +22 -0
- package/dist/discord/types/oauth2.js +1 -0
- package/dist/discord/types/permissions.d.ts +183 -0
- package/dist/discord/types/permissions.js +118 -0
- package/dist/discord/types/poll.d.ts +106 -0
- package/dist/discord/types/poll.js +8 -0
- package/dist/discord/types/sku.d.ts +47 -0
- package/dist/discord/types/sku.js +26 -0
- package/dist/discord/types/soundboard.d.ts +71 -0
- package/dist/discord/types/soundboard.js +1 -0
- package/dist/discord/types/stage-instance.d.ts +58 -0
- package/dist/discord/types/stage-instance.js +10 -0
- package/dist/discord/types/sticker.d.ts +115 -0
- package/dist/discord/types/sticker.js +20 -0
- package/dist/discord/types/subscription.d.ts +54 -0
- package/dist/discord/types/subscription.js +12 -0
- package/dist/discord/types/team.d.ts +55 -0
- package/dist/discord/types/team.js +21 -0
- package/dist/discord/types/user.d.ts +273 -0
- package/dist/discord/types/user.js +83 -0
- package/dist/discord/types/voice.d.ts +72 -0
- package/dist/discord/types/voice.js +1 -0
- package/dist/discord/types/webhook.d.ts +184 -0
- package/dist/discord/types/webhook.js +12 -0
- package/dist/events/convention.d.ts +25 -0
- package/dist/events/convention.js +97 -0
- package/dist/events/event.d.ts +8 -0
- package/dist/events/event.js +20 -0
- package/dist/events/registry.d.ts +706 -0
- package/dist/events/registry.js +839 -0
- package/dist/events/router.d.ts +45 -0
- package/dist/events/router.js +133 -0
- package/dist/events/types.d.ts +7 -0
- package/dist/events/types.js +48 -0
- package/dist/gateway/errors.d.ts +18 -0
- package/dist/gateway/errors.js +47 -0
- package/dist/gateway/gateway.d.ts +64 -0
- package/dist/gateway/gateway.js +117 -0
- package/dist/gateway/identify-queue.d.ts +25 -0
- package/dist/gateway/identify-queue.js +29 -0
- package/dist/gateway/shard.d.ts +94 -0
- package/dist/gateway/shard.js +414 -0
- package/dist/gateway/state.d.ts +11 -0
- package/dist/gateway/state.js +184 -0
- package/dist/index.d.ts +55 -18
- package/dist/index.js +38 -12
- package/dist/interactions/cooldown.d.ts +33 -0
- package/dist/interactions/cooldown.js +74 -0
- package/dist/interactions/dispatch.d.ts +91 -0
- package/dist/interactions/dispatch.js +110 -0
- package/dist/loader/generated.d.ts +37 -0
- package/dist/loader/generated.js +114 -0
- package/dist/loader/hot.d.ts +13 -0
- package/dist/loader/hot.js +85 -0
- package/dist/loader/loader.d.ts +72 -0
- package/dist/loader/loader.js +135 -0
- package/dist/loader/locate.d.ts +10 -0
- package/dist/loader/locate.js +36 -0
- package/dist/loader/watch.d.ts +17 -0
- package/dist/loader/watch.js +66 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +6 -0
- package/dist/messages/commands.d.ts +23 -0
- package/dist/messages/commands.js +123 -0
- package/dist/messages/convention.d.ts +89 -0
- package/dist/messages/convention.js +347 -0
- package/dist/messages/messages.d.ts +219 -0
- package/dist/messages/messages.js +30 -0
- package/dist/messages/phrases.d.ts +23 -0
- package/dist/messages/phrases.js +44 -0
- package/dist/messages/translate.d.ts +100 -0
- package/dist/messages/translate.js +249 -0
- package/dist/presence/convention.d.ts +26 -0
- package/dist/presence/convention.js +133 -0
- package/dist/presence/presence.d.ts +57 -0
- package/dist/presence/presence.js +27 -0
- package/dist/rest/errors.d.ts +55 -0
- package/dist/rest/errors.js +92 -0
- package/dist/rest/rate-limiter.d.ts +46 -0
- package/dist/rest/rate-limiter.js +153 -0
- package/dist/rest/rest.d.ts +63 -0
- package/dist/rest/rest.js +194 -0
- package/dist/structures/base.d.ts +48 -0
- package/dist/structures/base.js +84 -0
- package/dist/structures/channel.d.ts +380 -0
- package/dist/structures/channel.js +627 -0
- package/dist/structures/context.d.ts +30 -0
- package/dist/structures/context.js +7 -0
- package/dist/structures/emoji.d.ts +46 -0
- package/dist/structures/emoji.js +65 -0
- package/dist/structures/entities.d.ts +62 -0
- package/dist/structures/entities.js +226 -0
- package/dist/structures/guild.d.ts +348 -0
- package/dist/structures/guild.js +466 -0
- package/dist/structures/interaction.d.ts +197 -0
- package/dist/structures/interaction.js +396 -0
- package/dist/structures/invite.d.ts +38 -0
- package/dist/structures/invite.js +57 -0
- package/dist/structures/known.d.ts +28 -0
- package/dist/structures/known.js +58 -0
- package/dist/structures/member.d.ts +140 -0
- package/dist/structures/member.js +260 -0
- package/dist/structures/message.d.ts +197 -0
- package/dist/structures/message.js +268 -0
- package/dist/structures/payload.d.ts +91 -0
- package/dist/structures/payload.js +184 -0
- package/dist/structures/role.d.ts +69 -0
- package/dist/structures/role.js +112 -0
- package/dist/structures/user.d.ts +59 -0
- package/dist/structures/user.js +94 -0
- package/dist/structures/webhook.d.ts +46 -0
- package/dist/structures/webhook.js +79 -0
- package/dist/tasks/convention.d.ts +26 -0
- package/dist/tasks/convention.js +78 -0
- package/dist/tasks/schedule.d.ts +54 -0
- package/dist/tasks/schedule.js +236 -0
- package/dist/tasks/scheduler.d.ts +33 -0
- package/dist/tasks/scheduler.js +107 -0
- package/dist/tasks/task.d.ts +76 -0
- package/dist/tasks/task.js +28 -0
- package/dist/util/case.d.ts +13 -0
- package/dist/util/case.js +54 -0
- package/dist/util/duration.d.ts +8 -0
- package/dist/util/duration.js +29 -0
- package/dist/util/websocket.d.ts +9 -0
- package/dist/util/websocket.js +31 -0
- package/dist/voice/connection.d.ts +90 -0
- package/dist/voice/connection.js +494 -0
- package/dist/voice/dave.d.ts +109 -0
- package/dist/voice/dave.js +245 -0
- package/dist/voice/opus.d.ts +19 -0
- package/dist/voice/opus.js +273 -0
- package/dist/voice/session.d.ts +55 -0
- package/dist/voice/session.js +405 -0
- package/dist/voice/source.d.ts +22 -0
- package/dist/voice/source.js +195 -0
- package/dist/voice/transport.d.ts +43 -0
- package/dist/voice/transport.js +140 -0
- package/dist/voice/usage.d.ts +4 -0
- package/dist/voice/usage.js +33 -0
- package/package.json +26 -7
- package/vendor/dave/LICENSE +231 -0
- package/vendor/dave/libdave.d.mts +99 -0
- package/vendor/dave/libdave.mjs +2 -0
- package/vendor/dave/libdave.wasm +0 -0
- package/dist/components.d.ts +0 -97
- package/dist/components.js +0 -260
- package/dist/context.d.ts +0 -72
- package/dist/context.js +0 -273
- package/dist/discord/client.d.ts +0 -35
- package/dist/discord/client.js +0 -66
- package/dist/discord/constants.d.ts +0 -49
- package/dist/discord/constants.js +0 -61
- package/dist/discord/events.d.ts +0 -129
- package/dist/discord/events.js +0 -102
- package/dist/discord/gateway.d.ts +0 -61
- package/dist/discord/gateway.js +0 -320
- package/dist/discord/payloads.d.ts +0 -275
- package/dist/discord/payloads.js +0 -3
- package/dist/discord/presence.d.ts +0 -42
- package/dist/discord/presence.js +0 -51
- package/dist/discord/rest.d.ts +0 -49
- package/dist/discord/rest.js +0 -271
- package/dist/discord/types.d.ts +0 -334
- package/dist/discord/types.js +0 -4
- package/dist/events.d.ts +0 -94
- package/dist/events.js +0 -255
- package/dist/presence.d.ts +0 -92
- package/dist/presence.js +0 -250
- package/dist/structures/Channel.d.ts +0 -110
- package/dist/structures/Channel.js +0 -171
- package/dist/structures/Guild.d.ts +0 -70
- package/dist/structures/Guild.js +0 -105
- package/dist/structures/Interaction.d.ts +0 -113
- package/dist/structures/Interaction.js +0 -274
- package/dist/structures/Member.d.ts +0 -70
- package/dist/structures/Member.js +0 -124
- package/dist/structures/Message.d.ts +0 -87
- package/dist/structures/Message.js +0 -182
- package/dist/structures/Reaction.d.ts +0 -38
- package/dist/structures/Reaction.js +0 -64
- package/dist/structures/Role.d.ts +0 -43
- package/dist/structures/Role.js +0 -77
- package/dist/structures/User.d.ts +0 -41
- package/dist/structures/User.js +0 -79
- package/dist/structures/utils.d.ts +0 -72
- package/dist/structures/utils.js +0 -59
- package/dist/utils/errors.d.ts +0 -5
- package/dist/utils/errors.js +0 -28
- package/dist/utils/modules.d.ts +0 -39
- package/dist/utils/modules.js +0 -156
|
@@ -0,0 +1,834 @@
|
|
|
1
|
+
import type { ApplicationIntegrationType, RawApplication } from './application.js';
|
|
2
|
+
import type { ChannelType, RawChannel, RawThreadMember } from './channel.js';
|
|
3
|
+
import type { ISO8601Timestamp, Snowflake } from './common.js';
|
|
4
|
+
import type { RawComponent } from './component.js';
|
|
5
|
+
import type { RawEmoji } from './emoji.js';
|
|
6
|
+
import type { InteractionType, RawMessageInteraction, RawResolvedData } from './interaction.js';
|
|
7
|
+
import type { RawPoll, RawPollCreateRequest } from './poll.js';
|
|
8
|
+
import type { RawSticker, RawStickerItem } from './sticker.js';
|
|
9
|
+
import type { RawUser } from './user.js';
|
|
10
|
+
/**
|
|
11
|
+
* Message Structure
|
|
12
|
+
* @see https://docs.discord.com/developers/resources/message#message-object-message-structure
|
|
13
|
+
*/
|
|
14
|
+
export interface RawMessage {
|
|
15
|
+
/** id of the message */
|
|
16
|
+
id: Snowflake;
|
|
17
|
+
/** id of the channel the message was sent in */
|
|
18
|
+
channel_id: Snowflake;
|
|
19
|
+
/** the author of this message (not guaranteed to be a valid user, see below) */
|
|
20
|
+
author: RawUser;
|
|
21
|
+
/** contents of the message */
|
|
22
|
+
content: string;
|
|
23
|
+
/** when this message was sent */
|
|
24
|
+
timestamp: ISO8601Timestamp;
|
|
25
|
+
/** when this message was edited (or null if never) */
|
|
26
|
+
edited_timestamp: ISO8601Timestamp | null;
|
|
27
|
+
/** whether this was a TTS message */
|
|
28
|
+
tts: boolean;
|
|
29
|
+
/** whether this message mentions everyone */
|
|
30
|
+
mention_everyone: boolean;
|
|
31
|
+
/** users specifically mentioned in the message */
|
|
32
|
+
mentions: RawUser[];
|
|
33
|
+
/** roles specifically mentioned in this message */
|
|
34
|
+
mention_roles: Snowflake[];
|
|
35
|
+
/** channels specifically mentioned in this message */
|
|
36
|
+
mention_channels?: RawChannelMention[];
|
|
37
|
+
/** any attached files that are not referenced in embeds or components */
|
|
38
|
+
attachments: RawAttachment[];
|
|
39
|
+
/** any embedded content */
|
|
40
|
+
embeds: RawEmbed[];
|
|
41
|
+
/** reactions to the message */
|
|
42
|
+
reactions?: RawReaction[];
|
|
43
|
+
/** used for validating a message was sent */
|
|
44
|
+
nonce?: number | string;
|
|
45
|
+
/** whether this message is pinned */
|
|
46
|
+
pinned: boolean;
|
|
47
|
+
/** if the message is generated by a webhook, this is the webhook's id */
|
|
48
|
+
webhook_id?: Snowflake;
|
|
49
|
+
/** type of message */
|
|
50
|
+
type: MessageType;
|
|
51
|
+
/** sent with Rich Presence-related chat embeds */
|
|
52
|
+
activity?: RawMessageActivity;
|
|
53
|
+
/** sent with Rich Presence-related chat embeds */
|
|
54
|
+
application?: Partial<RawApplication>;
|
|
55
|
+
/** if the message is an Interaction or application-owned webhook, this is the id of the application */
|
|
56
|
+
application_id?: Snowflake;
|
|
57
|
+
/** message flags combined as a bitfield */
|
|
58
|
+
flags?: number;
|
|
59
|
+
/** data showing the source of a crosspost, channel follow add, pin, or reply message */
|
|
60
|
+
message_reference?: RawMessageReference;
|
|
61
|
+
/** the message associated with the `message_reference`. This is a minimal subset of fields in a message (e.g. `author` is excluded.) */
|
|
62
|
+
message_snapshots?: RawMessageSnapshot[];
|
|
63
|
+
/** the message associated with the message_reference */
|
|
64
|
+
referenced_message?: RawMessage | null;
|
|
65
|
+
/** Sent if the message is sent as a result of an interaction */
|
|
66
|
+
interaction_metadata?: RawMessageInteractionMetadata;
|
|
67
|
+
/** **Deprecated in favor of `interaction_metadata`**; sent if the message is a response to an interaction */
|
|
68
|
+
interaction?: RawMessageInteraction;
|
|
69
|
+
/** the thread that was started from this message, includes thread member object */
|
|
70
|
+
thread?: RawChannel;
|
|
71
|
+
/** sent if the message contains components like buttons, action rows, or other interactive components */
|
|
72
|
+
components?: RawComponent[];
|
|
73
|
+
/** sent if the message contains stickers */
|
|
74
|
+
sticker_items?: RawStickerItem[];
|
|
75
|
+
/** **Deprecated** the stickers sent with the message */
|
|
76
|
+
stickers?: RawSticker[];
|
|
77
|
+
/** A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread, it can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread */
|
|
78
|
+
position?: number;
|
|
79
|
+
/** data of the role subscription purchase or renewal that prompted this ROLE_SUBSCRIPTION_PURCHASE message */
|
|
80
|
+
role_subscription_data?: RawRoleSubscriptionData;
|
|
81
|
+
/** data for users, members, channels, and roles referenced in this message */
|
|
82
|
+
resolved?: RawResolvedData;
|
|
83
|
+
/** A poll! */
|
|
84
|
+
poll?: RawPoll;
|
|
85
|
+
/** the call associated with the message */
|
|
86
|
+
call?: RawMessageCall;
|
|
87
|
+
/** the custom client-side theme shared via the message */
|
|
88
|
+
shared_client_theme?: RawSharedClientTheme;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Message Types
|
|
92
|
+
* @see https://docs.discord.com/developers/resources/message#message-object-message-types
|
|
93
|
+
*/
|
|
94
|
+
export declare const MessageType: {
|
|
95
|
+
readonly Default: 0;
|
|
96
|
+
readonly RecipientAdd: 1;
|
|
97
|
+
readonly RecipientRemove: 2;
|
|
98
|
+
readonly Call: 3;
|
|
99
|
+
readonly ChannelNameChange: 4;
|
|
100
|
+
readonly ChannelIconChange: 5;
|
|
101
|
+
readonly ChannelPinnedMessage: 6;
|
|
102
|
+
readonly UserJoin: 7;
|
|
103
|
+
readonly GuildBoost: 8;
|
|
104
|
+
readonly GuildBoostTier1: 9;
|
|
105
|
+
readonly GuildBoostTier2: 10;
|
|
106
|
+
readonly GuildBoostTier3: 11;
|
|
107
|
+
readonly ChannelFollowAdd: 12;
|
|
108
|
+
readonly GuildDiscoveryDisqualified: 14;
|
|
109
|
+
readonly GuildDiscoveryRequalified: 15;
|
|
110
|
+
readonly GuildDiscoveryGracePeriodInitialWarning: 16;
|
|
111
|
+
readonly GuildDiscoveryGracePeriodFinalWarning: 17;
|
|
112
|
+
readonly ThreadCreated: 18;
|
|
113
|
+
readonly Reply: 19;
|
|
114
|
+
readonly ChatInputCommand: 20;
|
|
115
|
+
readonly ThreadStarterMessage: 21;
|
|
116
|
+
readonly GuildInviteReminder: 22;
|
|
117
|
+
readonly ContextMenuCommand: 23;
|
|
118
|
+
readonly AutoModerationAction: 24;
|
|
119
|
+
readonly RoleSubscriptionPurchase: 25;
|
|
120
|
+
readonly InteractionPremiumUpsell: 26;
|
|
121
|
+
readonly StageStart: 27;
|
|
122
|
+
readonly StageEnd: 28;
|
|
123
|
+
readonly StageSpeaker: 29;
|
|
124
|
+
readonly StageTopic: 31;
|
|
125
|
+
readonly GuildApplicationPremiumSubscription: 32;
|
|
126
|
+
readonly GuildIncidentAlertModeEnabled: 36;
|
|
127
|
+
readonly GuildIncidentAlertModeDisabled: 37;
|
|
128
|
+
readonly GuildIncidentReportRaid: 38;
|
|
129
|
+
readonly GuildIncidentReportFalseAlarm: 39;
|
|
130
|
+
readonly PurchaseNotification: 44;
|
|
131
|
+
readonly PollResult: 46;
|
|
132
|
+
};
|
|
133
|
+
export type MessageType = (typeof MessageType)[keyof typeof MessageType];
|
|
134
|
+
/**
|
|
135
|
+
* Message Activity Structure
|
|
136
|
+
* @see https://docs.discord.com/developers/resources/message#message-object-message-activity-structure
|
|
137
|
+
*/
|
|
138
|
+
export interface RawMessageActivity {
|
|
139
|
+
/** type of message activity */
|
|
140
|
+
type: MessageActivityType;
|
|
141
|
+
/** party_id from a Rich Presence event */
|
|
142
|
+
party_id?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Message Activity Types
|
|
146
|
+
* @see https://docs.discord.com/developers/resources/message#message-object-message-activity-types
|
|
147
|
+
*/
|
|
148
|
+
export declare const MessageActivityType: {
|
|
149
|
+
readonly Join: 1;
|
|
150
|
+
readonly Spectate: 2;
|
|
151
|
+
readonly Listen: 3;
|
|
152
|
+
readonly JoinRequest: 5;
|
|
153
|
+
readonly StreamRequest: 6;
|
|
154
|
+
};
|
|
155
|
+
export type MessageActivityType = (typeof MessageActivityType)[keyof typeof MessageActivityType];
|
|
156
|
+
/**
|
|
157
|
+
* Message Flags
|
|
158
|
+
* @see https://docs.discord.com/developers/resources/message#message-object-message-flags
|
|
159
|
+
*/
|
|
160
|
+
export declare const MessageFlags: {
|
|
161
|
+
/** this message has been published to subscribed channels (via Channel Following) */
|
|
162
|
+
readonly Crossposted: number;
|
|
163
|
+
/** this message originated from a message in another channel (via Channel Following) */
|
|
164
|
+
readonly IsCrosspost: number;
|
|
165
|
+
/** do not include any embeds when serializing this message */
|
|
166
|
+
readonly SuppressEmbeds: number;
|
|
167
|
+
/** the source message for this crosspost has been deleted (via Channel Following) */
|
|
168
|
+
readonly SourceMessageDeleted: number;
|
|
169
|
+
/** this message came from the urgent message system */
|
|
170
|
+
readonly Urgent: number;
|
|
171
|
+
/** this message has an associated thread, with the same id as the message */
|
|
172
|
+
readonly HasThread: number;
|
|
173
|
+
/** this message is only visible to the user who invoked the Interaction */
|
|
174
|
+
readonly Ephemeral: number;
|
|
175
|
+
/** this message is an Interaction Response and the bot is "thinking" */
|
|
176
|
+
readonly Loading: number;
|
|
177
|
+
/** this message failed to mention some roles and add their members to the thread */
|
|
178
|
+
readonly FailedToMentionSomeRolesInThread: number;
|
|
179
|
+
/** this message will not trigger push and desktop notifications */
|
|
180
|
+
readonly SuppressNotifications: number;
|
|
181
|
+
/** this message is a voice message */
|
|
182
|
+
readonly IsVoiceMessage: number;
|
|
183
|
+
/** this message has a snapshot (via Message Forwarding) */
|
|
184
|
+
readonly HasSnapshot: number;
|
|
185
|
+
/** allows you to create fully component-driven messages */
|
|
186
|
+
readonly IsComponentsV2: number;
|
|
187
|
+
};
|
|
188
|
+
export type MessageFlags = (typeof MessageFlags)[keyof typeof MessageFlags];
|
|
189
|
+
/**
|
|
190
|
+
* Application Command Interaction Metadata Structure
|
|
191
|
+
* @see https://docs.discord.com/developers/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure
|
|
192
|
+
*/
|
|
193
|
+
export interface RawApplicationCommandInteractionMetadata {
|
|
194
|
+
/** ID of the interaction */
|
|
195
|
+
id: Snowflake;
|
|
196
|
+
/** Type of interaction */
|
|
197
|
+
type: typeof InteractionType.ApplicationCommand;
|
|
198
|
+
/** User who triggered the interaction */
|
|
199
|
+
user: RawUser;
|
|
200
|
+
/** IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object */
|
|
201
|
+
authorizing_integration_owners: Partial<Record<`${ApplicationIntegrationType}`, Snowflake>>;
|
|
202
|
+
/** ID of the original response message, present only on follow-up messages */
|
|
203
|
+
original_response_message_id?: Snowflake;
|
|
204
|
+
/** The user the command was run on, present only on user command interactions */
|
|
205
|
+
target_user?: RawUser;
|
|
206
|
+
/** The ID of the message the command was run on, present only on message command interactions. The original response message will also have `message_reference` and `referenced_message` pointing to this message. */
|
|
207
|
+
target_message_id?: Snowflake;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Message Component Interaction Metadata Structure
|
|
211
|
+
* @see https://docs.discord.com/developers/resources/message#message-interaction-metadata-object-message-component-interaction-metadata-structure
|
|
212
|
+
*/
|
|
213
|
+
export interface RawMessageComponentInteractionMetadata {
|
|
214
|
+
/** ID of the interaction */
|
|
215
|
+
id: Snowflake;
|
|
216
|
+
/** Type of interaction */
|
|
217
|
+
type: typeof InteractionType.MessageComponent;
|
|
218
|
+
/** User who triggered the interaction */
|
|
219
|
+
user: RawUser;
|
|
220
|
+
/** IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object */
|
|
221
|
+
authorizing_integration_owners: Partial<Record<`${ApplicationIntegrationType}`, Snowflake>>;
|
|
222
|
+
/** ID of the original response message, present only on follow-up messages */
|
|
223
|
+
original_response_message_id?: Snowflake;
|
|
224
|
+
/** ID of the message that contained the interactive component */
|
|
225
|
+
interacted_message_id: Snowflake;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Modal Submit Interaction Metadata Structure
|
|
229
|
+
* @see https://docs.discord.com/developers/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure
|
|
230
|
+
*/
|
|
231
|
+
export interface RawModalSubmitInteractionMetadata {
|
|
232
|
+
/** ID of the interaction */
|
|
233
|
+
id: Snowflake;
|
|
234
|
+
/** Type of interaction */
|
|
235
|
+
type: typeof InteractionType.ModalSubmit;
|
|
236
|
+
/** User who triggered the interaction */
|
|
237
|
+
user: RawUser;
|
|
238
|
+
/** IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object */
|
|
239
|
+
authorizing_integration_owners: Partial<Record<`${ApplicationIntegrationType}`, Snowflake>>;
|
|
240
|
+
/** ID of the original response message, present only on follow-up messages */
|
|
241
|
+
original_response_message_id?: Snowflake;
|
|
242
|
+
/** Metadata for the interaction that was used to open the modal */
|
|
243
|
+
triggering_interaction_metadata: RawApplicationCommandInteractionMetadata | RawMessageComponentInteractionMetadata;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Message Call Object Structure
|
|
247
|
+
* @see https://docs.discord.com/developers/resources/message#message-call-object-message-call-object-structure
|
|
248
|
+
*/
|
|
249
|
+
export interface RawMessageCall {
|
|
250
|
+
/** array of user object ids that participated in the call */
|
|
251
|
+
participants: Snowflake[];
|
|
252
|
+
/** time when call ended */
|
|
253
|
+
ended_timestamp?: ISO8601Timestamp | null;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Message Reference Structure
|
|
257
|
+
* @see https://docs.discord.com/developers/resources/message#message-reference-structure
|
|
258
|
+
*/
|
|
259
|
+
export interface RawMessageReference {
|
|
260
|
+
/** type of reference. */
|
|
261
|
+
type?: MessageReferenceType;
|
|
262
|
+
/** id of the originating message */
|
|
263
|
+
message_id?: Snowflake;
|
|
264
|
+
/** id of the originating message's channel */
|
|
265
|
+
channel_id?: Snowflake;
|
|
266
|
+
/** id of the originating message's guild */
|
|
267
|
+
guild_id?: Snowflake;
|
|
268
|
+
/** when sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true */
|
|
269
|
+
fail_if_not_exists?: boolean;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Message Reference Types
|
|
273
|
+
* @see https://docs.discord.com/developers/resources/message#message-reference-types
|
|
274
|
+
*/
|
|
275
|
+
export declare const MessageReferenceType: {
|
|
276
|
+
/** A standard reference used by replies. */
|
|
277
|
+
readonly Default: 0;
|
|
278
|
+
/** Reference used to point to a message at a point in time. */
|
|
279
|
+
readonly Forward: 1;
|
|
280
|
+
};
|
|
281
|
+
export type MessageReferenceType = (typeof MessageReferenceType)[keyof typeof MessageReferenceType];
|
|
282
|
+
/**
|
|
283
|
+
* Message Snapshot Structure
|
|
284
|
+
* @see https://docs.discord.com/developers/resources/message#message-snapshot-structure
|
|
285
|
+
*/
|
|
286
|
+
export interface RawMessageSnapshot {
|
|
287
|
+
/** minimal subset of fields in the forwarded message */
|
|
288
|
+
message: Partial<RawMessage>;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Reaction Structure
|
|
292
|
+
* @see https://docs.discord.com/developers/resources/message#reaction-object-reaction-structure
|
|
293
|
+
*/
|
|
294
|
+
export interface RawReaction {
|
|
295
|
+
/** Total number of times this emoji has been used to react (including super reacts) */
|
|
296
|
+
count: number;
|
|
297
|
+
/** Reaction count details object */
|
|
298
|
+
count_details: RawReactionCountDetails;
|
|
299
|
+
/** Whether the current user reacted using this emoji */
|
|
300
|
+
me: boolean;
|
|
301
|
+
/** Whether the current user super-reacted using this emoji */
|
|
302
|
+
me_burst: boolean;
|
|
303
|
+
/** emoji information */
|
|
304
|
+
emoji: Partial<RawEmoji>;
|
|
305
|
+
/** HEX colors used for super reaction */
|
|
306
|
+
burst_colors: string[];
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Reaction Count Details Structure
|
|
310
|
+
* @see https://docs.discord.com/developers/resources/message#reaction-count-details-object-reaction-count-details-structure
|
|
311
|
+
*/
|
|
312
|
+
export interface RawReactionCountDetails {
|
|
313
|
+
/** Count of super reactions */
|
|
314
|
+
burst: number;
|
|
315
|
+
/** Count of normal reactions */
|
|
316
|
+
normal: number;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Embed Structure
|
|
320
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-structure
|
|
321
|
+
*/
|
|
322
|
+
export interface RawEmbed {
|
|
323
|
+
/** title of embed */
|
|
324
|
+
title?: string;
|
|
325
|
+
/** type of embed (always "rich" for webhook embeds) */
|
|
326
|
+
type?: EmbedType;
|
|
327
|
+
/** description of embed */
|
|
328
|
+
description?: string;
|
|
329
|
+
/** url of embed */
|
|
330
|
+
url?: string;
|
|
331
|
+
/** timestamp of embed content */
|
|
332
|
+
timestamp?: ISO8601Timestamp;
|
|
333
|
+
/** color code of the embed */
|
|
334
|
+
color?: number;
|
|
335
|
+
/** footer information */
|
|
336
|
+
footer?: RawEmbedFooter;
|
|
337
|
+
/** image information */
|
|
338
|
+
image?: RawEmbedImage;
|
|
339
|
+
/** thumbnail information */
|
|
340
|
+
thumbnail?: RawEmbedImage;
|
|
341
|
+
/** video information */
|
|
342
|
+
video?: RawEmbedVideo;
|
|
343
|
+
/** provider information */
|
|
344
|
+
provider?: RawEmbedProvider;
|
|
345
|
+
/** author information */
|
|
346
|
+
author?: RawEmbedAuthor;
|
|
347
|
+
/** fields information, max of 25 */
|
|
348
|
+
fields?: RawEmbedField[];
|
|
349
|
+
/** embed flags combined as a bitfield */
|
|
350
|
+
flags?: number;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Embed Flags
|
|
354
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-flags
|
|
355
|
+
*/
|
|
356
|
+
export declare const EmbedFlags: {
|
|
357
|
+
/** this embed is a fallback for a reply to an activity card */
|
|
358
|
+
readonly IsContentInventoryEntry: number;
|
|
359
|
+
};
|
|
360
|
+
export type EmbedFlags = (typeof EmbedFlags)[keyof typeof EmbedFlags];
|
|
361
|
+
/**
|
|
362
|
+
* Embed Video Structure
|
|
363
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-video-structure
|
|
364
|
+
*/
|
|
365
|
+
export interface RawEmbedVideo {
|
|
366
|
+
/** source url of video */
|
|
367
|
+
url?: string;
|
|
368
|
+
/** a proxied url of the video */
|
|
369
|
+
proxy_url?: string;
|
|
370
|
+
/** height of video */
|
|
371
|
+
height?: number;
|
|
372
|
+
/** width of video */
|
|
373
|
+
width?: number;
|
|
374
|
+
/** the video's media type */
|
|
375
|
+
content_type?: string;
|
|
376
|
+
/** thumbhash placeholder of the video */
|
|
377
|
+
placeholder?: string;
|
|
378
|
+
/** version of the placeholder */
|
|
379
|
+
placeholder_version?: number;
|
|
380
|
+
/** description (alt text) for the video */
|
|
381
|
+
description?: string;
|
|
382
|
+
/** embed media flags combined as a bitfield */
|
|
383
|
+
flags?: number;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Embed Image Structure
|
|
387
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-image-structure
|
|
388
|
+
*/
|
|
389
|
+
export interface RawEmbedImage {
|
|
390
|
+
/** source url of image (only supports http(s) and attachments) */
|
|
391
|
+
url: string;
|
|
392
|
+
/** a proxied url of the image */
|
|
393
|
+
proxy_url?: string;
|
|
394
|
+
/** height of image */
|
|
395
|
+
height?: number;
|
|
396
|
+
/** width of image */
|
|
397
|
+
width?: number;
|
|
398
|
+
/** the image's media type */
|
|
399
|
+
content_type?: string;
|
|
400
|
+
/** thumbhash placeholder of the image */
|
|
401
|
+
placeholder?: string;
|
|
402
|
+
/** version of the placeholder */
|
|
403
|
+
placeholder_version?: number;
|
|
404
|
+
/** description (alt text) for the image */
|
|
405
|
+
description?: string;
|
|
406
|
+
/** embed media flags combined as a bitfield */
|
|
407
|
+
flags?: number;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Embed Media Flags
|
|
411
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-media-flags
|
|
412
|
+
*/
|
|
413
|
+
export declare const EmbedMediaFlags: {
|
|
414
|
+
/** this image is animated */
|
|
415
|
+
readonly IsAnimated: number;
|
|
416
|
+
};
|
|
417
|
+
export type EmbedMediaFlags = (typeof EmbedMediaFlags)[keyof typeof EmbedMediaFlags];
|
|
418
|
+
/**
|
|
419
|
+
* Embed Provider Structure
|
|
420
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-provider-structure
|
|
421
|
+
*/
|
|
422
|
+
export interface RawEmbedProvider {
|
|
423
|
+
/** name of provider */
|
|
424
|
+
name?: string;
|
|
425
|
+
/** url of provider */
|
|
426
|
+
url?: string;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Embed Author Structure
|
|
430
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-author-structure
|
|
431
|
+
*/
|
|
432
|
+
export interface RawEmbedAuthor {
|
|
433
|
+
/** name of author */
|
|
434
|
+
name: string;
|
|
435
|
+
/** url of author (only supports http(s)) */
|
|
436
|
+
url?: string;
|
|
437
|
+
/** url of author icon (only supports http(s) and attachments) */
|
|
438
|
+
icon_url?: string;
|
|
439
|
+
/** a proxied url of author icon */
|
|
440
|
+
proxy_icon_url?: string;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Embed Footer Structure
|
|
444
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-footer-structure
|
|
445
|
+
*/
|
|
446
|
+
export interface RawEmbedFooter {
|
|
447
|
+
/** footer text */
|
|
448
|
+
text: string;
|
|
449
|
+
/** url of footer icon (only supports http(s) and attachments) */
|
|
450
|
+
icon_url?: string;
|
|
451
|
+
/** a proxied url of footer icon */
|
|
452
|
+
proxy_icon_url?: string;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Embed Field Structure
|
|
456
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-field-structure
|
|
457
|
+
*/
|
|
458
|
+
export interface RawEmbedField {
|
|
459
|
+
/** name of the field */
|
|
460
|
+
name: string;
|
|
461
|
+
/** value of the field */
|
|
462
|
+
value: string;
|
|
463
|
+
/** whether or not this field should display inline */
|
|
464
|
+
inline?: boolean;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Attachment Structure
|
|
468
|
+
* @see https://docs.discord.com/developers/resources/message#attachment-object-attachment-structure
|
|
469
|
+
*/
|
|
470
|
+
export interface RawAttachment {
|
|
471
|
+
/** attachment id */
|
|
472
|
+
id: Snowflake;
|
|
473
|
+
/** name of file attached */
|
|
474
|
+
filename: string;
|
|
475
|
+
/** the title of the file */
|
|
476
|
+
title?: string;
|
|
477
|
+
/** description (alt text) for the file (max 1024 characters) */
|
|
478
|
+
description?: string;
|
|
479
|
+
/** the attachment's media type */
|
|
480
|
+
content_type?: string;
|
|
481
|
+
/** size of file in bytes */
|
|
482
|
+
size: number;
|
|
483
|
+
/** source url of file */
|
|
484
|
+
url: string;
|
|
485
|
+
/** a proxied url of file */
|
|
486
|
+
proxy_url: string;
|
|
487
|
+
/** height of file (if image or video) */
|
|
488
|
+
height?: number | null;
|
|
489
|
+
/** width of file (if image or video) */
|
|
490
|
+
width?: number | null;
|
|
491
|
+
/** thumbhash placeholder (if image or video) */
|
|
492
|
+
placeholder?: string;
|
|
493
|
+
/** version of the placeholder (if image or video) */
|
|
494
|
+
placeholder_version?: number;
|
|
495
|
+
/** whether this attachment is ephemeral */
|
|
496
|
+
ephemeral?: boolean;
|
|
497
|
+
/** the duration of the audio or video file */
|
|
498
|
+
duration_secs?: number;
|
|
499
|
+
/** base64 encoded bytearray representing a sampled waveform (currently for voice messages) */
|
|
500
|
+
waveform?: string;
|
|
501
|
+
/** attachment flags combined as a bitfield */
|
|
502
|
+
flags?: number;
|
|
503
|
+
/** for Clips, array of users who were in the stream */
|
|
504
|
+
clip_participants?: RawUser[];
|
|
505
|
+
/** for Clips, when the clip was created */
|
|
506
|
+
clip_created_at?: ISO8601Timestamp;
|
|
507
|
+
/** for Clips, the application in the stream, if recognized */
|
|
508
|
+
application?: Partial<RawApplication> | null;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Attachment Request Structure
|
|
512
|
+
* @see https://docs.discord.com/developers/resources/message#attachment-object-attachment-request-structure
|
|
513
|
+
*/
|
|
514
|
+
export interface RawAttachmentRequest {
|
|
515
|
+
/** attachment id, for new attachments this must match the `n` in `files[n]` */
|
|
516
|
+
id: Snowflake | number;
|
|
517
|
+
/** name of file attached */
|
|
518
|
+
filename?: string;
|
|
519
|
+
/** the title of the file */
|
|
520
|
+
title?: string;
|
|
521
|
+
/** description (alt text) for the file (max 1024 characters) */
|
|
522
|
+
description?: string;
|
|
523
|
+
/** the duration of the audio or video file (required for voice messages) */
|
|
524
|
+
duration_secs?: number;
|
|
525
|
+
/** base64 encoded bytearray representing a sampled waveform (required for voice messages) */
|
|
526
|
+
waveform?: string;
|
|
527
|
+
/** whether the attachment should be marked as a spoiler and blurred until clicked, this sets the `IS_SPOILER` attachment flag */
|
|
528
|
+
is_spoiler?: boolean;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Attachment Flags
|
|
532
|
+
* @see https://docs.discord.com/developers/resources/message#attachment-object-attachment-flags
|
|
533
|
+
*/
|
|
534
|
+
export declare const AttachmentFlags: {
|
|
535
|
+
/** this attachment is a Clip from a stream */
|
|
536
|
+
readonly IsClip: number;
|
|
537
|
+
/** this attachment is the thumbnail of a thread in a media channel, displayed in the grid but not on the message */
|
|
538
|
+
readonly IsThumbnail: number;
|
|
539
|
+
/** this attachment has been edited using the remix feature on mobile (deprecated) */
|
|
540
|
+
readonly IsRemix: number;
|
|
541
|
+
/** this attachment was marked as a spoiler and is blurred until clicked */
|
|
542
|
+
readonly IsSpoiler: number;
|
|
543
|
+
/** this attachment is an animated image */
|
|
544
|
+
readonly IsAnimated: number;
|
|
545
|
+
};
|
|
546
|
+
export type AttachmentFlags = (typeof AttachmentFlags)[keyof typeof AttachmentFlags];
|
|
547
|
+
/**
|
|
548
|
+
* Channel Mention Structure
|
|
549
|
+
* @see https://docs.discord.com/developers/resources/message#channel-mention-object-channel-mention-structure
|
|
550
|
+
*/
|
|
551
|
+
export interface RawChannelMention {
|
|
552
|
+
/** id of the channel */
|
|
553
|
+
id: Snowflake;
|
|
554
|
+
/** id of the guild containing the channel */
|
|
555
|
+
guild_id: Snowflake;
|
|
556
|
+
/** the type of channel */
|
|
557
|
+
type: ChannelType;
|
|
558
|
+
/** the name of the channel */
|
|
559
|
+
name: string;
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Allowed Mention Types
|
|
563
|
+
* @see https://docs.discord.com/developers/resources/message#allowed-mentions-object-allowed-mention-types
|
|
564
|
+
*/
|
|
565
|
+
export declare const AllowedMentionType: {
|
|
566
|
+
/** Controls role mentions */
|
|
567
|
+
readonly Roles: 'roles';
|
|
568
|
+
/** Controls user mentions */
|
|
569
|
+
readonly Users: 'users';
|
|
570
|
+
/** Controls @everyone and @here mentions */
|
|
571
|
+
readonly Everyone: 'everyone';
|
|
572
|
+
};
|
|
573
|
+
export type AllowedMentionType = (typeof AllowedMentionType)[keyof typeof AllowedMentionType];
|
|
574
|
+
/**
|
|
575
|
+
* Default Settings for Allowed Mentions
|
|
576
|
+
* @see https://docs.discord.com/developers/resources/message#allowed-mentions-object-default-settings-for-allowed-mentions
|
|
577
|
+
*/
|
|
578
|
+
export interface RawAllowedMentions {
|
|
579
|
+
/** An array of allowed mention types to parse from the content */
|
|
580
|
+
parse?: AllowedMentionType[];
|
|
581
|
+
/** Array of role ids to mention, max 100 */
|
|
582
|
+
roles?: Snowflake[];
|
|
583
|
+
/** Array of user ids to mention, max 100 */
|
|
584
|
+
users?: Snowflake[];
|
|
585
|
+
/** For replies, whether to mention the author of the message being replied to, defaults to false */
|
|
586
|
+
replied_user?: boolean;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Role Subscription Data Object Structure
|
|
590
|
+
* @see https://docs.discord.com/developers/resources/message#role-subscription-data-object-role-subscription-data-object-structure
|
|
591
|
+
*/
|
|
592
|
+
export interface RawRoleSubscriptionData {
|
|
593
|
+
/** the id of the sku and listing that the user is subscribed to */
|
|
594
|
+
role_subscription_listing_id: Snowflake;
|
|
595
|
+
/** the name of the tier that the user is subscribed to */
|
|
596
|
+
tier_name: string;
|
|
597
|
+
/** the cumulative number of months that the user has been subscribed for */
|
|
598
|
+
total_months_subscribed: number;
|
|
599
|
+
/** whether this notification is for a renewal rather than a new purchase */
|
|
600
|
+
is_renewal: boolean;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Message Pin Object Structure
|
|
604
|
+
* @see https://docs.discord.com/developers/resources/message#message-pin-object-message-pin-object-structure
|
|
605
|
+
*/
|
|
606
|
+
export interface RawMessagePin {
|
|
607
|
+
/** the time the message was pinned */
|
|
608
|
+
pinned_at: ISO8601Timestamp;
|
|
609
|
+
/** the pinned message */
|
|
610
|
+
message: RawMessage;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Shared Client Theme Object Structure
|
|
614
|
+
* @see https://docs.discord.com/developers/resources/message#shared-client-theme-object-shared-client-theme-object-structure
|
|
615
|
+
*/
|
|
616
|
+
export interface RawSharedClientTheme {
|
|
617
|
+
/** the hexadecimal-encoded colors of the theme (max of 5) */
|
|
618
|
+
colors: string[];
|
|
619
|
+
/** the direction of the theme's colors (max of 360) */
|
|
620
|
+
gradient_angle: number;
|
|
621
|
+
/** the intensity of the theme's colors (max of 100) */
|
|
622
|
+
base_mix: number;
|
|
623
|
+
/** the mode of the theme */
|
|
624
|
+
base_theme?: SharedClientThemeBaseType | null;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Base Theme Types
|
|
628
|
+
* @see https://docs.discord.com/developers/resources/message#base-theme-types
|
|
629
|
+
*/
|
|
630
|
+
export declare const SharedClientThemeBaseType: {
|
|
631
|
+
readonly Unset: 0;
|
|
632
|
+
readonly Dark: 1;
|
|
633
|
+
readonly Light: 2;
|
|
634
|
+
readonly Darker: 3;
|
|
635
|
+
readonly Midnight: 4;
|
|
636
|
+
};
|
|
637
|
+
export type SharedClientThemeBaseType = (typeof SharedClientThemeBaseType)[keyof typeof SharedClientThemeBaseType];
|
|
638
|
+
/**
|
|
639
|
+
* Query String Params
|
|
640
|
+
* @see https://docs.discord.com/developers/resources/message#get-channel-messages-query-string-params
|
|
641
|
+
*/
|
|
642
|
+
export interface GetChannelMessagesQuery {
|
|
643
|
+
/** Get messages around this message ID */
|
|
644
|
+
around?: Snowflake;
|
|
645
|
+
/** Get messages before this message ID */
|
|
646
|
+
before?: Snowflake;
|
|
647
|
+
/** Get messages after this message ID */
|
|
648
|
+
after?: Snowflake;
|
|
649
|
+
/** Max number of messages to return (1-100) */
|
|
650
|
+
limit?: number;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Query String Params
|
|
654
|
+
* @see https://docs.discord.com/developers/resources/message#search-guild-messages-query-string-params
|
|
655
|
+
*/
|
|
656
|
+
export interface SearchGuildMessagesQuery {
|
|
657
|
+
/** Max number of messages to return (1-25, default 25) */
|
|
658
|
+
limit?: number;
|
|
659
|
+
/** Number to offset the returned messages by (max 9975) */
|
|
660
|
+
offset?: number;
|
|
661
|
+
/** Get messages before this message ID */
|
|
662
|
+
max_id?: Snowflake;
|
|
663
|
+
/** Get messages after this message ID */
|
|
664
|
+
min_id?: Snowflake;
|
|
665
|
+
/** Max number of words to skip between matching tokens in the search `content` (max 100, default 2) */
|
|
666
|
+
slop?: number;
|
|
667
|
+
/** Filter messages by content (max 1024 characters) */
|
|
668
|
+
content?: string;
|
|
669
|
+
/** Filter messages by these channels (max 500) */
|
|
670
|
+
channel_id?: Snowflake[];
|
|
671
|
+
/** Filter messages by author type */
|
|
672
|
+
author_type?: string[];
|
|
673
|
+
/** Filter messages by these authors (max 100) */
|
|
674
|
+
author_id?: Snowflake[];
|
|
675
|
+
/** Filter messages that mention these users (max 100) */
|
|
676
|
+
mentions?: Snowflake[];
|
|
677
|
+
/** Filter messages that mention these roles (max 100) */
|
|
678
|
+
mentions_role_id?: Snowflake[];
|
|
679
|
+
/** Filter messages that do or do not mention @everyone */
|
|
680
|
+
mention_everyone?: boolean;
|
|
681
|
+
/** Filter messages that reply to these users (max 100) */
|
|
682
|
+
replied_to_user_id?: Snowflake[];
|
|
683
|
+
/** Filter messages that reply to these messages (max 100) */
|
|
684
|
+
replied_to_message_id?: Snowflake[];
|
|
685
|
+
/** Filter messages by whether they are or are not pinned */
|
|
686
|
+
pinned?: boolean;
|
|
687
|
+
/** Filter messages by whether or not they have specific things */
|
|
688
|
+
has?: string[];
|
|
689
|
+
/** Filter messages by embed type */
|
|
690
|
+
embed_type?: string[];
|
|
691
|
+
/** Filter messages by embed provider (case-sensitive, e.g. `Tenor`) (max 256 characters, max 100) */
|
|
692
|
+
embed_provider?: string[];
|
|
693
|
+
/** Filter messages by link hostname (e.g. `discordapp.com`) (max 256 characters, max 100) */
|
|
694
|
+
link_hostname?: string[];
|
|
695
|
+
/** Filter messages by attachment filename (max 1024 characters, max 100) */
|
|
696
|
+
attachment_filename?: string[];
|
|
697
|
+
/** Filter messages by attachment extension (e.g. `txt`) (max 256 characters, max 100) */
|
|
698
|
+
attachment_extension?: string[];
|
|
699
|
+
/** The sorting algorithm to use */
|
|
700
|
+
sort_by?: string;
|
|
701
|
+
/** The direction to sort (`asc` or `desc`, default `desc`) */
|
|
702
|
+
sort_order?: 'asc' | 'desc';
|
|
703
|
+
/** Whether to include results from age-restricted channels (default false) */
|
|
704
|
+
include_nsfw?: boolean;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Response Body
|
|
708
|
+
* @see https://docs.discord.com/developers/resources/message#search-guild-messages-response-body
|
|
709
|
+
*/
|
|
710
|
+
export interface SearchGuildMessagesResponse {
|
|
711
|
+
/** Whether the guild is undergoing a deep historical indexing operation */
|
|
712
|
+
doing_deep_historical_index: boolean;
|
|
713
|
+
/** The number of documents that have been indexed during the current index operation, if any */
|
|
714
|
+
documents_indexed?: number;
|
|
715
|
+
/** The total number of results that match the query */
|
|
716
|
+
total_results: number;
|
|
717
|
+
/** A nested array of messages that match the query */
|
|
718
|
+
messages: RawMessage[][];
|
|
719
|
+
/** The threads that contain the returned messages */
|
|
720
|
+
threads?: RawChannel[];
|
|
721
|
+
/** A thread member object for each returned thread the current user has joined */
|
|
722
|
+
members?: RawThreadMember[];
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* JSON/Form Params
|
|
726
|
+
* @see https://docs.discord.com/developers/resources/message#create-message-json/form-params
|
|
727
|
+
*/
|
|
728
|
+
export interface CreateMessageJSONParams {
|
|
729
|
+
/** Message contents (up to 2000 characters) */
|
|
730
|
+
content?: string;
|
|
731
|
+
/** Can be used to verify a message was sent (up to 25 characters). Value will appear in the Message Create event. */
|
|
732
|
+
nonce?: number | string;
|
|
733
|
+
/** `true` if this is a TTS message */
|
|
734
|
+
tts?: boolean;
|
|
735
|
+
/** Up to 10 `rich` embeds (up to 6000 characters) */
|
|
736
|
+
embeds?: RawEmbed[];
|
|
737
|
+
/** Allowed mentions for the message */
|
|
738
|
+
allowed_mentions?: RawAllowedMentions;
|
|
739
|
+
/** Include to make your message a reply or a forward */
|
|
740
|
+
message_reference?: RawMessageReference;
|
|
741
|
+
/** Components to include with the message */
|
|
742
|
+
components?: RawComponent[];
|
|
743
|
+
/** IDs of up to 3 stickers in the server to send in the message */
|
|
744
|
+
sticker_ids?: Snowflake[];
|
|
745
|
+
/** JSON-encoded body of non-file params, only for `multipart/form-data` requests. See Uploading Files */
|
|
746
|
+
payload_json?: string;
|
|
747
|
+
/** Metadata for the attachments. See Uploading Files */
|
|
748
|
+
attachments?: Partial<RawAttachmentRequest>[];
|
|
749
|
+
/** Message flags combined as a bitfield (only `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS`, `IS_VOICE_MESSAGE`, and `IS_COMPONENTS_V2` can be set) */
|
|
750
|
+
flags?: number;
|
|
751
|
+
/** If true and nonce is present, it will be checked for uniqueness in the past few minutes. 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. */
|
|
752
|
+
enforce_nonce?: boolean;
|
|
753
|
+
/** A poll! */
|
|
754
|
+
poll?: RawPollCreateRequest;
|
|
755
|
+
/** The custom client-side theme to share via the message */
|
|
756
|
+
shared_client_theme?: RawSharedClientTheme;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Query String Params
|
|
760
|
+
* @see https://docs.discord.com/developers/resources/message#get-reactions-query-string-params
|
|
761
|
+
*/
|
|
762
|
+
export interface GetReactionsQuery {
|
|
763
|
+
/** The type of reaction */
|
|
764
|
+
type?: ReactionType;
|
|
765
|
+
/** Get users after this user ID */
|
|
766
|
+
after?: Snowflake;
|
|
767
|
+
/** Max number of users to return (1-100) */
|
|
768
|
+
limit?: number;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Reaction Types
|
|
772
|
+
* @see https://docs.discord.com/developers/resources/message#get-reactions-reaction-types
|
|
773
|
+
*/
|
|
774
|
+
export declare const ReactionType: {
|
|
775
|
+
readonly Normal: 0;
|
|
776
|
+
readonly Burst: 1;
|
|
777
|
+
};
|
|
778
|
+
export type ReactionType = (typeof ReactionType)[keyof typeof ReactionType];
|
|
779
|
+
/**
|
|
780
|
+
* JSON/Form Params
|
|
781
|
+
* @see https://docs.discord.com/developers/resources/message#edit-message-json/form-params
|
|
782
|
+
*/
|
|
783
|
+
export interface EditMessageJSONParams {
|
|
784
|
+
/** Message contents (up to 2000 characters) */
|
|
785
|
+
content?: string;
|
|
786
|
+
/** Up to 10 `rich` embeds (up to 6000 characters) */
|
|
787
|
+
embeds?: RawEmbed[];
|
|
788
|
+
/** Edit the flags of a message (`SUPPRESS_EMBEDS` and `IS_COMPONENTS_V2` only) */
|
|
789
|
+
flags?: number;
|
|
790
|
+
/** Allowed mentions for the message */
|
|
791
|
+
allowed_mentions?: RawAllowedMentions;
|
|
792
|
+
/** Components to include with the message */
|
|
793
|
+
components?: RawComponent[];
|
|
794
|
+
/** JSON-encoded body of non-file params (multipart/form-data only). See Uploading Files */
|
|
795
|
+
payload_json?: string;
|
|
796
|
+
/** Attached files to keep and their metadata. See Uploading Files */
|
|
797
|
+
attachments?: Partial<RawAttachmentRequest>[];
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* JSON Params
|
|
801
|
+
* @see https://docs.discord.com/developers/resources/message#bulk-delete-messages-json-params
|
|
802
|
+
*/
|
|
803
|
+
export interface BulkDeleteMessagesJSONParams {
|
|
804
|
+
/** an array of message ids to delete (2-100) */
|
|
805
|
+
messages: Snowflake[];
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Query String Params
|
|
809
|
+
* @see https://docs.discord.com/developers/resources/message#get-channel-pins-query-string-params
|
|
810
|
+
*/
|
|
811
|
+
export interface GetChannelPinsQuery {
|
|
812
|
+
/** Get messages pinned before this timestamp */
|
|
813
|
+
before?: ISO8601Timestamp;
|
|
814
|
+
/** Max number of pins to return (1-50) */
|
|
815
|
+
limit?: number;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Response Structure
|
|
819
|
+
* @see https://docs.discord.com/developers/resources/message#get-channel-pins-response-structure
|
|
820
|
+
*/
|
|
821
|
+
export interface GetChannelPinsResponse {
|
|
822
|
+
items: RawMessagePin[];
|
|
823
|
+
has_more: boolean;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Embed Types
|
|
827
|
+
* @see https://docs.discord.com/developers/resources/message#embed-object-embed-types
|
|
828
|
+
*/
|
|
829
|
+
export type EmbedType = 'rich' | 'image' | 'video' | 'gifv' | 'article' | 'link' | 'poll_result';
|
|
830
|
+
/**
|
|
831
|
+
* Message Interaction Metadata: its shape depends on the interaction type.
|
|
832
|
+
* @see https://docs.discord.com/developers/resources/message#message-interaction-metadata-object
|
|
833
|
+
*/
|
|
834
|
+
export type RawMessageInteractionMetadata = RawApplicationCommandInteractionMetadata | RawMessageComponentInteractionMetadata | RawModalSubmitInteractionMetadata;
|