chapterjs 0.1.2 → 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,273 @@
|
|
|
1
|
+
import type { ImageData, Locale, Snowflake } from './common.js';
|
|
2
|
+
import type { RawIntegration } from './guild.js';
|
|
3
|
+
/**
|
|
4
|
+
* User Structure
|
|
5
|
+
* @see https://docs.discord.com/developers/resources/user#user-object-user-structure
|
|
6
|
+
*/
|
|
7
|
+
export interface RawUser {
|
|
8
|
+
/** the user's id */
|
|
9
|
+
id: Snowflake;
|
|
10
|
+
/** the user's username, not unique across the platform */
|
|
11
|
+
username: string;
|
|
12
|
+
/** the user's Discord-tag */
|
|
13
|
+
discriminator: string;
|
|
14
|
+
/** the user's display name, if it is set */
|
|
15
|
+
global_name: string | null;
|
|
16
|
+
/** the user's avatar hash */
|
|
17
|
+
avatar: string | null;
|
|
18
|
+
/** whether the user belongs to an OAuth2 application */
|
|
19
|
+
bot?: boolean;
|
|
20
|
+
/** whether the user is an Official Discord System user (part of the urgent message system) */
|
|
21
|
+
system?: boolean;
|
|
22
|
+
/** whether the user has two factor enabled on their account */
|
|
23
|
+
mfa_enabled?: boolean;
|
|
24
|
+
/** the user's banner hash */
|
|
25
|
+
banner?: string | null;
|
|
26
|
+
/** the user's banner color encoded as an integer representation of hexadecimal color code */
|
|
27
|
+
accent_color?: number | null;
|
|
28
|
+
/** the user's chosen language option */
|
|
29
|
+
locale?: Locale;
|
|
30
|
+
/** whether the email on this account has been verified */
|
|
31
|
+
verified?: boolean;
|
|
32
|
+
/** the user's email */
|
|
33
|
+
email?: string | null;
|
|
34
|
+
/** the flags on a user's account */
|
|
35
|
+
flags?: number;
|
|
36
|
+
/** the type of Nitro subscription on a user's account */
|
|
37
|
+
premium_type?: UserPremiumType;
|
|
38
|
+
/** the public flags on a user's account */
|
|
39
|
+
public_flags?: number;
|
|
40
|
+
/** data for the user's avatar decoration */
|
|
41
|
+
avatar_decoration_data?: RawAvatarDecorationData | null;
|
|
42
|
+
/** data for the user's collectibles */
|
|
43
|
+
collectibles?: RawCollectibles | null;
|
|
44
|
+
/** the user's primary guild */
|
|
45
|
+
primary_guild?: RawUserPrimaryGuild | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* User Flags
|
|
49
|
+
* @see https://docs.discord.com/developers/resources/user#user-object-user-flags
|
|
50
|
+
*/
|
|
51
|
+
export declare const UserFlags: {
|
|
52
|
+
/** Discord Employee */
|
|
53
|
+
readonly Staff: number;
|
|
54
|
+
/** Partnered Server Owner */
|
|
55
|
+
readonly Partner: number;
|
|
56
|
+
/** HypeSquad Events Member */
|
|
57
|
+
readonly Hypesquad: number;
|
|
58
|
+
/** Bug Hunter Level 1 */
|
|
59
|
+
readonly BugHunterLevel1: number;
|
|
60
|
+
/** House Bravery Member */
|
|
61
|
+
readonly HypesquadOnlineHouse1: number;
|
|
62
|
+
/** House Brilliance Member */
|
|
63
|
+
readonly HypesquadOnlineHouse2: number;
|
|
64
|
+
/** House Balance Member */
|
|
65
|
+
readonly HypesquadOnlineHouse3: number;
|
|
66
|
+
/** Early Nitro Supporter */
|
|
67
|
+
readonly PremiumEarlySupporter: number;
|
|
68
|
+
/** User is a team */
|
|
69
|
+
readonly TeamPseudoUser: number;
|
|
70
|
+
/** Bug Hunter Level 2 */
|
|
71
|
+
readonly BugHunterLevel2: number;
|
|
72
|
+
/** Verified Bot */
|
|
73
|
+
readonly VerifiedBot: number;
|
|
74
|
+
/** Early Verified Bot Developer */
|
|
75
|
+
readonly VerifiedDeveloper: number;
|
|
76
|
+
/** Moderator Programs Alumni */
|
|
77
|
+
readonly CertifiedModerator: number;
|
|
78
|
+
/** Bot uses only HTTP interactions and is shown in the online member list */
|
|
79
|
+
readonly BotHttpInteractions: number;
|
|
80
|
+
};
|
|
81
|
+
export type UserFlags = (typeof UserFlags)[keyof typeof UserFlags];
|
|
82
|
+
/**
|
|
83
|
+
* Premium Types
|
|
84
|
+
* @see https://docs.discord.com/developers/resources/user#user-object-premium-types
|
|
85
|
+
*/
|
|
86
|
+
export declare const UserPremiumType: {
|
|
87
|
+
readonly None: 0;
|
|
88
|
+
readonly NitroClassic: 1;
|
|
89
|
+
readonly Nitro: 2;
|
|
90
|
+
readonly NitroBasic: 3;
|
|
91
|
+
};
|
|
92
|
+
export type UserPremiumType = (typeof UserPremiumType)[keyof typeof UserPremiumType];
|
|
93
|
+
/**
|
|
94
|
+
* User Primary Guild
|
|
95
|
+
* @see https://docs.discord.com/developers/resources/user#user-object-user-primary-guild
|
|
96
|
+
*/
|
|
97
|
+
export interface RawUserPrimaryGuild {
|
|
98
|
+
/** the id of the user's primary guild */
|
|
99
|
+
identity_guild_id: Snowflake | null;
|
|
100
|
+
/** whether the user is displaying the primary guild's server tag. This can be `null` if the system clears the identity, e.g. the server no longer supports tags. This will be `false` if the user manually removes their tag. */
|
|
101
|
+
identity_enabled: boolean | null;
|
|
102
|
+
/** the text of the user's server tag. Limited to 4 characters */
|
|
103
|
+
tag: string | null;
|
|
104
|
+
/** the server tag badge hash */
|
|
105
|
+
badge: string | null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Avatar Decoration Data Structure
|
|
109
|
+
* @see https://docs.discord.com/developers/resources/user#avatar-decoration-data-object-avatar-decoration-data-structure
|
|
110
|
+
*/
|
|
111
|
+
export interface RawAvatarDecorationData {
|
|
112
|
+
/** the avatar decoration hash */
|
|
113
|
+
asset: string;
|
|
114
|
+
/** id of the avatar decoration's SKU */
|
|
115
|
+
sku_id: Snowflake;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Collectible Structure
|
|
119
|
+
* @see https://docs.discord.com/developers/resources/user#collectibles-collectible-structure
|
|
120
|
+
*/
|
|
121
|
+
export interface RawCollectibles {
|
|
122
|
+
/** object mapping of nameplate data */
|
|
123
|
+
nameplate?: RawNameplate;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Nameplate Structure
|
|
127
|
+
* @see https://docs.discord.com/developers/resources/user#nameplate-nameplate-structure
|
|
128
|
+
*/
|
|
129
|
+
export interface RawNameplate {
|
|
130
|
+
/** id of the nameplate SKU */
|
|
131
|
+
sku_id: Snowflake;
|
|
132
|
+
/** path to the nameplate asset */
|
|
133
|
+
asset: string;
|
|
134
|
+
/** the label of this nameplate. Currently unused */
|
|
135
|
+
label: string;
|
|
136
|
+
/** background color of the nameplate, one of: `crimson`, `berry`, `sky`, `teal`, `forest`, `bubble_gum`, `violet`, `cobalt`, `clover`, `lemon`, `white` */
|
|
137
|
+
palette: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Connection Structure
|
|
141
|
+
* @see https://docs.discord.com/developers/resources/user#connection-object-connection-structure
|
|
142
|
+
*/
|
|
143
|
+
export interface RawConnection {
|
|
144
|
+
/** id of the connection account */
|
|
145
|
+
id: string;
|
|
146
|
+
/** the username of the connection account */
|
|
147
|
+
name: string;
|
|
148
|
+
/** the service of this connection */
|
|
149
|
+
type: ConnectionService;
|
|
150
|
+
/** whether the connection is revoked */
|
|
151
|
+
revoked?: boolean;
|
|
152
|
+
/** an array of partial server integrations */
|
|
153
|
+
integrations?: Partial<RawIntegration>[];
|
|
154
|
+
/** whether the connection is verified */
|
|
155
|
+
verified: boolean;
|
|
156
|
+
/** whether friend sync is enabled for this connection */
|
|
157
|
+
friend_sync: boolean;
|
|
158
|
+
/** whether activities related to this connection will be shown in presence updates */
|
|
159
|
+
show_activity: boolean;
|
|
160
|
+
/** whether this connection has a corresponding third party OAuth2 token */
|
|
161
|
+
two_way_link: boolean;
|
|
162
|
+
/** visibility of this connection */
|
|
163
|
+
visibility: ConnectionVisibilityType;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Services
|
|
167
|
+
* @see https://docs.discord.com/developers/resources/user#connection-object-services
|
|
168
|
+
*/
|
|
169
|
+
export declare const ConnectionService: {
|
|
170
|
+
readonly AmazonMusic: 'amazon-music';
|
|
171
|
+
readonly BungieNet: 'bungie';
|
|
172
|
+
readonly Bluesky: 'bluesky';
|
|
173
|
+
readonly Crunchyroll: 'crunchyroll';
|
|
174
|
+
readonly Domain: 'domain';
|
|
175
|
+
readonly EBay: 'ebay';
|
|
176
|
+
readonly EpicGames: 'epicgames';
|
|
177
|
+
readonly Facebook: 'facebook';
|
|
178
|
+
readonly GitHub: 'github';
|
|
179
|
+
readonly Instagram: 'instagram';
|
|
180
|
+
readonly Mastodon: 'mastodon';
|
|
181
|
+
readonly PayPal: 'paypal';
|
|
182
|
+
readonly PlayStationNetwork: 'playstation';
|
|
183
|
+
readonly Reddit: 'reddit';
|
|
184
|
+
readonly Roblox: 'roblox';
|
|
185
|
+
readonly Spotify: 'spotify';
|
|
186
|
+
readonly Skype: 'skype';
|
|
187
|
+
readonly Steam: 'steam';
|
|
188
|
+
readonly TikTok: 'tiktok';
|
|
189
|
+
readonly Twitch: 'twitch';
|
|
190
|
+
readonly XTwitter: 'twitter';
|
|
191
|
+
readonly Xbox: 'xbox';
|
|
192
|
+
readonly YouTube: 'youtube';
|
|
193
|
+
};
|
|
194
|
+
export type ConnectionService = (typeof ConnectionService)[keyof typeof ConnectionService];
|
|
195
|
+
/**
|
|
196
|
+
* Visibility Types
|
|
197
|
+
* @see https://docs.discord.com/developers/resources/user#connection-object-visibility-types
|
|
198
|
+
*/
|
|
199
|
+
export declare const ConnectionVisibilityType: {
|
|
200
|
+
/** invisible to everyone except the user themselves */
|
|
201
|
+
readonly None: 0;
|
|
202
|
+
/** visible to everyone */
|
|
203
|
+
readonly Everyone: 1;
|
|
204
|
+
};
|
|
205
|
+
export type ConnectionVisibilityType = (typeof ConnectionVisibilityType)[keyof typeof ConnectionVisibilityType];
|
|
206
|
+
/**
|
|
207
|
+
* Application Role Connection Structure
|
|
208
|
+
* @see https://docs.discord.com/developers/resources/user#application-role-connection-object-application-role-connection-structure
|
|
209
|
+
*/
|
|
210
|
+
export interface RawApplicationRoleConnection {
|
|
211
|
+
/** the vanity name of the platform a bot has connected (max 50 characters) */
|
|
212
|
+
platform_name: string | null;
|
|
213
|
+
/** object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */
|
|
214
|
+
metadata: Record<string, string>;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* JSON Params
|
|
218
|
+
* @see https://docs.discord.com/developers/resources/user#modify-current-user-json-params
|
|
219
|
+
*/
|
|
220
|
+
export interface ModifyCurrentUserJSONParams {
|
|
221
|
+
/** user's username, if changed may cause the user's discriminator to be randomized. */
|
|
222
|
+
username?: string;
|
|
223
|
+
/** if passed, modifies the user's avatar */
|
|
224
|
+
avatar?: ImageData | null;
|
|
225
|
+
/** if passed, modifies the user's banner */
|
|
226
|
+
banner?: ImageData | null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Query String Params
|
|
230
|
+
* @see https://docs.discord.com/developers/resources/user#get-current-user-guilds-query-string-params
|
|
231
|
+
*/
|
|
232
|
+
export interface GetCurrentUserGuildsQuery {
|
|
233
|
+
/** get guilds before this guild ID */
|
|
234
|
+
before?: Snowflake;
|
|
235
|
+
/** get guilds after this guild ID */
|
|
236
|
+
after?: Snowflake;
|
|
237
|
+
/** max number of guilds to return (1-200) */
|
|
238
|
+
limit?: number;
|
|
239
|
+
/** only return guilds in this shard (`0` to `max_concurrency - 1`) */
|
|
240
|
+
shard?: number;
|
|
241
|
+
/** include approximate member and presence counts in response */
|
|
242
|
+
with_counts?: boolean;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* JSON Params
|
|
246
|
+
* @see https://docs.discord.com/developers/resources/user#create-dm-json-params
|
|
247
|
+
*/
|
|
248
|
+
export interface CreateDmJSONParams {
|
|
249
|
+
/** the recipient to open a DM channel with */
|
|
250
|
+
recipient_id: Snowflake;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* JSON Params
|
|
254
|
+
* @see https://docs.discord.com/developers/resources/user#create-group-dm-json-params
|
|
255
|
+
*/
|
|
256
|
+
export interface CreateGroupDmJSONParams {
|
|
257
|
+
/** access tokens of users that have granted your app the `gdm.join` scope */
|
|
258
|
+
access_tokens: string[];
|
|
259
|
+
/** a dictionary of user ids to their respective nicknames */
|
|
260
|
+
nicks: Record<Snowflake, string>;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* JSON Params
|
|
264
|
+
* @see https://docs.discord.com/developers/resources/user#update-current-user-application-role-connection-json-params
|
|
265
|
+
*/
|
|
266
|
+
export interface UpdateCurrentUserApplicationRoleConnectionJSONParams {
|
|
267
|
+
/** the vanity name of the platform a bot has connected (max 50 characters) */
|
|
268
|
+
platform_name?: string;
|
|
269
|
+
/** the username on the platform a bot has connected (max 100 characters) */
|
|
270
|
+
platform_username?: string;
|
|
271
|
+
/** object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */
|
|
272
|
+
metadata?: Record<string, string>;
|
|
273
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Flags
|
|
3
|
+
* @see https://docs.discord.com/developers/resources/user#user-object-user-flags
|
|
4
|
+
*/
|
|
5
|
+
export const UserFlags = {
|
|
6
|
+
/** Discord Employee */
|
|
7
|
+
Staff: 1 << 0,
|
|
8
|
+
/** Partnered Server Owner */
|
|
9
|
+
Partner: 1 << 1,
|
|
10
|
+
/** HypeSquad Events Member */
|
|
11
|
+
Hypesquad: 1 << 2,
|
|
12
|
+
/** Bug Hunter Level 1 */
|
|
13
|
+
BugHunterLevel1: 1 << 3,
|
|
14
|
+
/** House Bravery Member */
|
|
15
|
+
HypesquadOnlineHouse1: 1 << 6,
|
|
16
|
+
/** House Brilliance Member */
|
|
17
|
+
HypesquadOnlineHouse2: 1 << 7,
|
|
18
|
+
/** House Balance Member */
|
|
19
|
+
HypesquadOnlineHouse3: 1 << 8,
|
|
20
|
+
/** Early Nitro Supporter */
|
|
21
|
+
PremiumEarlySupporter: 1 << 9,
|
|
22
|
+
/** User is a team */
|
|
23
|
+
TeamPseudoUser: 1 << 10,
|
|
24
|
+
/** Bug Hunter Level 2 */
|
|
25
|
+
BugHunterLevel2: 1 << 14,
|
|
26
|
+
/** Verified Bot */
|
|
27
|
+
VerifiedBot: 1 << 16,
|
|
28
|
+
/** Early Verified Bot Developer */
|
|
29
|
+
VerifiedDeveloper: 1 << 17,
|
|
30
|
+
/** Moderator Programs Alumni */
|
|
31
|
+
CertifiedModerator: 1 << 18,
|
|
32
|
+
/** Bot uses only HTTP interactions and is shown in the online member list */
|
|
33
|
+
BotHttpInteractions: 1 << 19,
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Premium Types
|
|
37
|
+
* @see https://docs.discord.com/developers/resources/user#user-object-premium-types
|
|
38
|
+
*/
|
|
39
|
+
export const UserPremiumType = {
|
|
40
|
+
None: 0,
|
|
41
|
+
NitroClassic: 1,
|
|
42
|
+
Nitro: 2,
|
|
43
|
+
NitroBasic: 3,
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Services
|
|
47
|
+
* @see https://docs.discord.com/developers/resources/user#connection-object-services
|
|
48
|
+
*/
|
|
49
|
+
export const ConnectionService = {
|
|
50
|
+
AmazonMusic: 'amazon-music',
|
|
51
|
+
BungieNet: 'bungie',
|
|
52
|
+
Bluesky: 'bluesky',
|
|
53
|
+
Crunchyroll: 'crunchyroll',
|
|
54
|
+
Domain: 'domain',
|
|
55
|
+
EBay: 'ebay',
|
|
56
|
+
EpicGames: 'epicgames',
|
|
57
|
+
Facebook: 'facebook',
|
|
58
|
+
GitHub: 'github',
|
|
59
|
+
Instagram: 'instagram',
|
|
60
|
+
Mastodon: 'mastodon',
|
|
61
|
+
PayPal: 'paypal',
|
|
62
|
+
PlayStationNetwork: 'playstation',
|
|
63
|
+
Reddit: 'reddit',
|
|
64
|
+
Roblox: 'roblox',
|
|
65
|
+
Spotify: 'spotify',
|
|
66
|
+
Skype: 'skype',
|
|
67
|
+
Steam: 'steam',
|
|
68
|
+
TikTok: 'tiktok',
|
|
69
|
+
Twitch: 'twitch',
|
|
70
|
+
XTwitter: 'twitter',
|
|
71
|
+
Xbox: 'xbox',
|
|
72
|
+
YouTube: 'youtube',
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Visibility Types
|
|
76
|
+
* @see https://docs.discord.com/developers/resources/user#connection-object-visibility-types
|
|
77
|
+
*/
|
|
78
|
+
export const ConnectionVisibilityType = {
|
|
79
|
+
/** invisible to everyone except the user themselves */
|
|
80
|
+
None: 0,
|
|
81
|
+
/** visible to everyone */
|
|
82
|
+
Everyone: 1,
|
|
83
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ISO8601Timestamp, Snowflake } from './common.js';
|
|
2
|
+
import type { RawGuildMember } from './guild.js';
|
|
3
|
+
/**
|
|
4
|
+
* Voice State Structure
|
|
5
|
+
* @see https://docs.discord.com/developers/resources/voice#voice-state-object-voice-state-structure
|
|
6
|
+
*/
|
|
7
|
+
export interface RawVoiceState {
|
|
8
|
+
/** the guild id this voice state is for */
|
|
9
|
+
guild_id?: Snowflake;
|
|
10
|
+
/** the channel id this user is connected to */
|
|
11
|
+
channel_id: Snowflake | null;
|
|
12
|
+
/** the user id this voice state is for */
|
|
13
|
+
user_id: Snowflake;
|
|
14
|
+
/** the guild member this voice state is for */
|
|
15
|
+
member?: RawGuildMember;
|
|
16
|
+
/** the session id for this voice state */
|
|
17
|
+
session_id: string;
|
|
18
|
+
/** whether this user is deafened by the server */
|
|
19
|
+
deaf: boolean;
|
|
20
|
+
/** whether this user is muted by the server */
|
|
21
|
+
mute: boolean;
|
|
22
|
+
/** whether this user is locally deafened */
|
|
23
|
+
self_deaf: boolean;
|
|
24
|
+
/** whether this user is locally muted */
|
|
25
|
+
self_mute: boolean;
|
|
26
|
+
/** whether this user is streaming using "Go Live" */
|
|
27
|
+
self_stream?: boolean;
|
|
28
|
+
/** whether this user's camera is enabled */
|
|
29
|
+
self_video: boolean;
|
|
30
|
+
/** whether this user's permission to speak is denied */
|
|
31
|
+
suppress: boolean;
|
|
32
|
+
/** the time at which the user requested to speak */
|
|
33
|
+
request_to_speak_timestamp: ISO8601Timestamp | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Voice Region Structure
|
|
37
|
+
* @see https://docs.discord.com/developers/resources/voice#voice-region-object-voice-region-structure
|
|
38
|
+
*/
|
|
39
|
+
export interface RawVoiceRegion {
|
|
40
|
+
/** unique ID for the region */
|
|
41
|
+
id: string;
|
|
42
|
+
/** name of the region */
|
|
43
|
+
name: string;
|
|
44
|
+
/** true for a single server that is closest to the current user's client */
|
|
45
|
+
optimal: boolean;
|
|
46
|
+
/** whether this is a deprecated voice region (avoid switching to these) */
|
|
47
|
+
deprecated: boolean;
|
|
48
|
+
/** whether this is a custom voice region (used for events/etc) */
|
|
49
|
+
custom: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* JSON Params
|
|
53
|
+
* @see https://docs.discord.com/developers/resources/voice#modify-current-user-voice-state-json-params
|
|
54
|
+
*/
|
|
55
|
+
export interface ModifyCurrentUserVoiceStateJSONParams {
|
|
56
|
+
/** the id of the channel the user is currently in */
|
|
57
|
+
channel_id?: Snowflake;
|
|
58
|
+
/** toggles the user's suppress state */
|
|
59
|
+
suppress?: boolean;
|
|
60
|
+
/** sets the user's request to speak */
|
|
61
|
+
request_to_speak_timestamp?: ISO8601Timestamp | null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* JSON Params
|
|
65
|
+
* @see https://docs.discord.com/developers/resources/voice#modify-user-voice-state-json-params
|
|
66
|
+
*/
|
|
67
|
+
export interface ModifyUserVoiceStateJSONParams {
|
|
68
|
+
/** the id of the channel the user is currently in */
|
|
69
|
+
channel_id?: Snowflake;
|
|
70
|
+
/** toggles the user's suppress state */
|
|
71
|
+
suppress?: boolean;
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { RawChannel } from './channel.js';
|
|
2
|
+
import type { ImageData, Snowflake } from './common.js';
|
|
3
|
+
import type { RawComponent } from './component.js';
|
|
4
|
+
import type { RawGuild } from './guild.js';
|
|
5
|
+
import type { RawAllowedMentions, RawAttachmentRequest, RawEmbed } from './message.js';
|
|
6
|
+
import type { RawPollCreateRequest } from './poll.js';
|
|
7
|
+
import type { RawUser } from './user.js';
|
|
8
|
+
/**
|
|
9
|
+
* Webhook Structure
|
|
10
|
+
* @see https://docs.discord.com/developers/resources/webhook#webhook-object-webhook-structure
|
|
11
|
+
*/
|
|
12
|
+
export interface RawWebhook {
|
|
13
|
+
/** the id of the webhook */
|
|
14
|
+
id: Snowflake;
|
|
15
|
+
/** the type of the webhook */
|
|
16
|
+
type: WebhookType;
|
|
17
|
+
/** the guild id this webhook is for, if any */
|
|
18
|
+
guild_id?: Snowflake | null;
|
|
19
|
+
/** the channel id this webhook is for, if any */
|
|
20
|
+
channel_id: Snowflake | null;
|
|
21
|
+
/** the user this webhook was created by (not returned when getting a webhook with its token) */
|
|
22
|
+
user?: RawUser;
|
|
23
|
+
/** the default name of the webhook */
|
|
24
|
+
name: string | null;
|
|
25
|
+
/** the default user avatar hash of the webhook */
|
|
26
|
+
avatar: string | null;
|
|
27
|
+
/** the secure token of the webhook (returned for Incoming Webhooks) */
|
|
28
|
+
token?: string;
|
|
29
|
+
/** the bot/OAuth2 application that created this webhook */
|
|
30
|
+
application_id: Snowflake | null;
|
|
31
|
+
/** the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) */
|
|
32
|
+
source_guild?: Partial<RawGuild>;
|
|
33
|
+
/** the channel that this webhook is following (returned for Channel Follower Webhooks) */
|
|
34
|
+
source_channel?: Partial<RawChannel>;
|
|
35
|
+
/** the url used for executing the webhook (returned by the webhooks OAuth2 flow) */
|
|
36
|
+
url?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Webhook Types
|
|
40
|
+
* @see https://docs.discord.com/developers/resources/webhook#webhook-object-webhook-types
|
|
41
|
+
*/
|
|
42
|
+
export declare const WebhookType: {
|
|
43
|
+
/** Incoming Webhooks can post messages to channels with a generated token */
|
|
44
|
+
readonly Incoming: 1;
|
|
45
|
+
/** Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels */
|
|
46
|
+
readonly ChannelFollower: 2;
|
|
47
|
+
/** Application webhooks are webhooks used with Interactions */
|
|
48
|
+
readonly Application: 3;
|
|
49
|
+
};
|
|
50
|
+
export type WebhookType = (typeof WebhookType)[keyof typeof WebhookType];
|
|
51
|
+
/**
|
|
52
|
+
* JSON Params
|
|
53
|
+
* @see https://docs.discord.com/developers/resources/webhook#create-webhook-json-params
|
|
54
|
+
*/
|
|
55
|
+
export interface CreateWebhookJSONParams {
|
|
56
|
+
/** name of the webhook (1-80 characters) */
|
|
57
|
+
name: string;
|
|
58
|
+
/** image for the default webhook avatar */
|
|
59
|
+
avatar?: ImageData | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* JSON Params
|
|
63
|
+
* @see https://docs.discord.com/developers/resources/webhook#modify-webhook-json-params
|
|
64
|
+
*/
|
|
65
|
+
export interface ModifyWebhookJSONParams {
|
|
66
|
+
/** the default name of the webhook */
|
|
67
|
+
name?: string;
|
|
68
|
+
/** image for the default webhook avatar */
|
|
69
|
+
avatar?: ImageData | null;
|
|
70
|
+
/** the new channel id this webhook should be moved to */
|
|
71
|
+
channel_id?: Snowflake;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Query String Params
|
|
75
|
+
* @see https://docs.discord.com/developers/resources/webhook#execute-webhook-query-string-params
|
|
76
|
+
*/
|
|
77
|
+
export interface ExecuteWebhookQuery {
|
|
78
|
+
/** waits for server confirmation of message send before response, and returns the created message body (defaults to `false`; when `false` a message that is not saved does not return an error) */
|
|
79
|
+
wait?: boolean;
|
|
80
|
+
/** Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived. */
|
|
81
|
+
thread_id?: Snowflake;
|
|
82
|
+
/** whether to respect the `components` field of the request. When enabled, allows application-owned webhooks to use all components and non-owned webhooks to use non-interactive components. (defaults to `false`) */
|
|
83
|
+
with_components?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* JSON/Form Params
|
|
87
|
+
* @see https://docs.discord.com/developers/resources/webhook#execute-webhook-json/form-params
|
|
88
|
+
*/
|
|
89
|
+
export interface ExecuteWebhookJSONParams {
|
|
90
|
+
/** the message contents (up to 2000 characters) */
|
|
91
|
+
content?: string;
|
|
92
|
+
/** override the default username of the webhook */
|
|
93
|
+
username?: string;
|
|
94
|
+
/** override the default avatar of the webhook */
|
|
95
|
+
avatar_url?: string;
|
|
96
|
+
/** true if this is a TTS message */
|
|
97
|
+
tts?: boolean;
|
|
98
|
+
/** embedded `rich` content */
|
|
99
|
+
embeds?: RawEmbed[];
|
|
100
|
+
/** allowed mentions for the message */
|
|
101
|
+
allowed_mentions?: RawAllowedMentions;
|
|
102
|
+
/** the components to include with the message */
|
|
103
|
+
components?: RawComponent[];
|
|
104
|
+
/** JSON encoded body of non-file params */
|
|
105
|
+
payload_json?: string;
|
|
106
|
+
/** metadata for the attachments */
|
|
107
|
+
attachments?: Partial<RawAttachmentRequest>[];
|
|
108
|
+
/** message flags combined as a bitfield (only `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS` and `IS_COMPONENTS_V2` can be set) */
|
|
109
|
+
flags?: number;
|
|
110
|
+
/** name of thread to create (requires the webhook channel to be a forum or media channel) */
|
|
111
|
+
thread_name?: string;
|
|
112
|
+
/** array of tag ids to apply to the thread (requires the webhook channel to be a forum or media channel) */
|
|
113
|
+
applied_tags?: Snowflake[];
|
|
114
|
+
/** A poll! */
|
|
115
|
+
poll?: RawPollCreateRequest;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Query String Params
|
|
119
|
+
* @see https://docs.discord.com/developers/resources/webhook#execute-slackcompatible-webhook-query-string-params
|
|
120
|
+
*/
|
|
121
|
+
export interface ExecuteSlackCompatibleWebhookQuery {
|
|
122
|
+
/** id of the thread to send the message in */
|
|
123
|
+
thread_id?: Snowflake;
|
|
124
|
+
/** waits for server confirmation of message send before response (defaults to `true`; when `false` a message that is not saved does not return an error) */
|
|
125
|
+
wait?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Query String Params
|
|
129
|
+
* @see https://docs.discord.com/developers/resources/webhook#execute-githubcompatible-webhook-query-string-params
|
|
130
|
+
*/
|
|
131
|
+
export interface ExecuteGitHubCompatibleWebhookQuery {
|
|
132
|
+
/** id of the thread to send the message in */
|
|
133
|
+
thread_id?: Snowflake;
|
|
134
|
+
/** waits for server confirmation of message send before response (defaults to `true`; when `false` a message that is not saved does not return an error) */
|
|
135
|
+
wait?: boolean;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Query String Params
|
|
139
|
+
* @see https://docs.discord.com/developers/resources/webhook#get-webhook-message-query-string-params
|
|
140
|
+
*/
|
|
141
|
+
export interface GetWebhookMessageQuery {
|
|
142
|
+
/** id of the thread the message is in */
|
|
143
|
+
thread_id?: Snowflake;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Query String Params
|
|
147
|
+
* @see https://docs.discord.com/developers/resources/webhook#edit-webhook-message-query-string-params
|
|
148
|
+
*/
|
|
149
|
+
export interface EditWebhookMessageQuery {
|
|
150
|
+
/** id of the thread the message is in */
|
|
151
|
+
thread_id?: Snowflake;
|
|
152
|
+
/** whether to respect the `components` field of the request. When enabled, allows application-owned webhooks to use all components and non-owned webhooks to use non-interactive components. (defaults to `false`) */
|
|
153
|
+
with_components?: boolean;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* JSON/Form Params
|
|
157
|
+
* @see https://docs.discord.com/developers/resources/webhook#edit-webhook-message-json/form-params
|
|
158
|
+
*/
|
|
159
|
+
export interface EditWebhookMessageJSONParams {
|
|
160
|
+
/** the message contents (up to 2000 characters) */
|
|
161
|
+
content?: string;
|
|
162
|
+
/** embedded `rich` content */
|
|
163
|
+
embeds?: RawEmbed[];
|
|
164
|
+
/** message flags combined as a bitfield (`SUPPRESS_EMBEDS` and `IS_COMPONENTS_V2` only) */
|
|
165
|
+
flags?: number;
|
|
166
|
+
/** allowed mentions for the message */
|
|
167
|
+
allowed_mentions?: RawAllowedMentions;
|
|
168
|
+
/** the components to include with the message */
|
|
169
|
+
components?: RawComponent[];
|
|
170
|
+
/** JSON encoded body of non-file params (multipart/form-data only) */
|
|
171
|
+
payload_json?: string;
|
|
172
|
+
/** attached files to keep and their metadata */
|
|
173
|
+
attachments?: Partial<RawAttachmentRequest>[];
|
|
174
|
+
/** A poll! */
|
|
175
|
+
poll?: RawPollCreateRequest;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Query String Params
|
|
179
|
+
* @see https://docs.discord.com/developers/resources/webhook#delete-webhook-message-query-string-params
|
|
180
|
+
*/
|
|
181
|
+
export interface DeleteWebhookMessageQuery {
|
|
182
|
+
/** id of the thread the message is in */
|
|
183
|
+
thread_id?: Snowflake;
|
|
184
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook Types
|
|
3
|
+
* @see https://docs.discord.com/developers/resources/webhook#webhook-object-webhook-types
|
|
4
|
+
*/
|
|
5
|
+
export const WebhookType = {
|
|
6
|
+
/** Incoming Webhooks can post messages to channels with a generated token */
|
|
7
|
+
Incoming: 1,
|
|
8
|
+
/** Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels */
|
|
9
|
+
ChannelFollower: 2,
|
|
10
|
+
/** Application webhooks are webhooks used with Interactions */
|
|
11
|
+
Application: 3,
|
|
12
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Convention } from '../loader/loader.js';
|
|
2
|
+
import { type EventContexts, type EventName } from './registry.js';
|
|
3
|
+
/** One reaction to an event: a file of `src/events/<event>/`. */
|
|
4
|
+
export interface EventHandler<Name extends EventName = EventName> {
|
|
5
|
+
/** The event, which is the name of the folder the file is in. */
|
|
6
|
+
readonly name: Name;
|
|
7
|
+
readonly handler: (context: EventContexts[Name]) => unknown;
|
|
8
|
+
/** The options the file gave to `event()`, checked. */
|
|
9
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* `src/events/`: one folder per event, named after it, and in it one file
|
|
13
|
+
* per reaction. The name of a file is free; it exports by default what
|
|
14
|
+
* `event()` returns:
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* // src/events/memberJoin/welcome.ts
|
|
18
|
+
* import { event } from 'chapterjs';
|
|
19
|
+
*
|
|
20
|
+
* export default event(async ({ member, guild }) => {
|
|
21
|
+
* await member.send(`Welcome to ${guild.name}!`);
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const eventsConvention: Convention<EventHandler>;
|