chapterjs 0.1.2 → 0.2.0
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 +205 -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 +253 -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 +135 -0
- package/dist/cli/project.js +517 -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 +360 -0
- package/dist/commands/command.js +28 -0
- package/dist/commands/declaration.d.ts +77 -0
- package/dist/commands/declaration.js +492 -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 +47 -0
- package/dist/commands/tree.js +216 -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 +106 -0
- package/dist/components/component.d.ts +140 -0
- package/dist/components/component.js +39 -0
- package/dist/components/custom-id.d.ts +72 -0
- package/dist/components/custom-id.js +128 -0
- package/dist/components/declaration.d.ts +42 -0
- package/dist/components/declaration.js +342 -0
- package/dist/components/declared.d.ts +29 -0
- package/dist/components/declared.js +49 -0
- package/dist/components/embed.d.ts +29 -0
- package/dist/components/embed.js +11 -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 +245 -0
- package/dist/components/modal.js +398 -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 +19 -0
- package/dist/components/router.js +251 -0
- package/dist/components/select.d.ts +146 -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/declaration.d.ts +16 -0
- package/dist/events/declaration.js +80 -0
- package/dist/events/event.d.ts +45 -0
- package/dist/events/event.js +34 -0
- package/dist/events/registry.d.ts +697 -0
- package/dist/events/registry.js +839 -0
- package/dist/events/router.d.ts +46 -0
- package/dist/events/router.js +133 -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 +57 -18
- package/dist/index.js +40 -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 +10 -0
- package/dist/loader/generated.js +80 -0
- package/dist/loader/hot.d.ts +13 -0
- package/dist/loader/hot.js +85 -0
- package/dist/loader/loader.d.ts +85 -0
- package/dist/loader/loader.js +119 -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 +2 -0
- package/dist/main.js +5 -0
- package/dist/messages/commands.d.ts +23 -0
- package/dist/messages/commands.js +142 -0
- package/dist/messages/declaration.d.ts +89 -0
- package/dist/messages/declaration.js +455 -0
- package/dist/messages/messages.d.ts +241 -0
- package/dist/messages/messages.js +31 -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/declaration.d.ts +19 -0
- package/dist/presence/declaration.js +118 -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/declaration.d.ts +16 -0
- package/dist/tasks/declaration.js +56 -0
- package/dist/tasks/schedule.d.ts +54 -0
- package/dist/tasks/schedule.js +236 -0
- package/dist/tasks/scheduler.d.ts +35 -0
- package/dist/tasks/scheduler.js +107 -0
- package/dist/tasks/task.d.ts +75 -0
- package/dist/tasks/task.js +27 -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,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button Styles
|
|
3
|
+
* @see https://docs.discord.com/developers/components/reference#button-button-styles
|
|
4
|
+
*/
|
|
5
|
+
export const ButtonStyle = {
|
|
6
|
+
Primary: 1,
|
|
7
|
+
Secondary: 2,
|
|
8
|
+
Success: 3,
|
|
9
|
+
Danger: 4,
|
|
10
|
+
Link: 5,
|
|
11
|
+
Premium: 6,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Text Input Styles
|
|
15
|
+
* @see https://docs.discord.com/developers/components/reference#text-input-text-input-styles
|
|
16
|
+
*/
|
|
17
|
+
export const TextInputStyle = {
|
|
18
|
+
/** Single-line input */
|
|
19
|
+
Short: 1,
|
|
20
|
+
/** Multi-line input */
|
|
21
|
+
Paragraph: 2,
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Unfurled Media Item Flags
|
|
25
|
+
* @see https://docs.discord.com/developers/components/reference#unfurled-media-item-unfurled-media-item-flags
|
|
26
|
+
*/
|
|
27
|
+
export const UnfurledMediaItemFlags = {
|
|
28
|
+
/** This image is animated */
|
|
29
|
+
IsAnimated: 1 << 0,
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Component Types
|
|
33
|
+
* @see https://docs.discord.com/developers/components/reference#component-object-component-types
|
|
34
|
+
*/
|
|
35
|
+
export const ComponentType = {
|
|
36
|
+
/** Container to display a row of interactive components */
|
|
37
|
+
ActionRow: 1,
|
|
38
|
+
/** Button object */
|
|
39
|
+
Button: 2,
|
|
40
|
+
/** Select menu for picking from defined text options */
|
|
41
|
+
StringSelect: 3,
|
|
42
|
+
/** Text input object */
|
|
43
|
+
TextInput: 4,
|
|
44
|
+
/** Select menu for users */
|
|
45
|
+
UserSelect: 5,
|
|
46
|
+
/** Select menu for roles */
|
|
47
|
+
RoleSelect: 6,
|
|
48
|
+
/** Select menu for mentionables (users and roles) */
|
|
49
|
+
MentionableSelect: 7,
|
|
50
|
+
/** Select menu for channels */
|
|
51
|
+
ChannelSelect: 8,
|
|
52
|
+
/** Container to display text alongside an accessory component */
|
|
53
|
+
Section: 9,
|
|
54
|
+
/** Markdown text */
|
|
55
|
+
TextDisplay: 10,
|
|
56
|
+
/** Small image that can be used as an accessory */
|
|
57
|
+
Thumbnail: 11,
|
|
58
|
+
/** Display images and other media */
|
|
59
|
+
MediaGallery: 12,
|
|
60
|
+
/** Displays an attached file */
|
|
61
|
+
File: 13,
|
|
62
|
+
/** Component to add vertical padding between other components */
|
|
63
|
+
Separator: 14,
|
|
64
|
+
/** Container that visually groups a set of components */
|
|
65
|
+
Container: 17,
|
|
66
|
+
/** Container associating a label and description with a component */
|
|
67
|
+
Label: 18,
|
|
68
|
+
/** Component for uploading files */
|
|
69
|
+
FileUpload: 19,
|
|
70
|
+
/** Single-choice set of options */
|
|
71
|
+
RadioGroup: 21,
|
|
72
|
+
/** Multi-selectable group of checkboxes */
|
|
73
|
+
CheckboxGroup: 22,
|
|
74
|
+
/** Single checkbox for yes/no choice */
|
|
75
|
+
Checkbox: 23,
|
|
76
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ImageData, Snowflake } from './common.js';
|
|
2
|
+
import type { RawUser } from './user.js';
|
|
3
|
+
/**
|
|
4
|
+
* Emoji Structure
|
|
5
|
+
* @see https://docs.discord.com/developers/resources/emoji#emoji-object-emoji-structure
|
|
6
|
+
*/
|
|
7
|
+
export interface RawEmoji {
|
|
8
|
+
/** emoji id */
|
|
9
|
+
id: Snowflake | null;
|
|
10
|
+
/** emoji name */
|
|
11
|
+
name: string | null;
|
|
12
|
+
/** roles allowed to use this emoji */
|
|
13
|
+
roles?: Snowflake[];
|
|
14
|
+
/** user that created this emoji */
|
|
15
|
+
user?: RawUser;
|
|
16
|
+
/** whether this emoji must be wrapped in colons */
|
|
17
|
+
require_colons?: boolean;
|
|
18
|
+
/** whether this emoji is managed */
|
|
19
|
+
managed?: boolean;
|
|
20
|
+
/** whether this emoji is animated */
|
|
21
|
+
animated?: boolean;
|
|
22
|
+
/** whether this emoji can be used, may be false due to loss of Server Boosts */
|
|
23
|
+
available?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* JSON Params
|
|
27
|
+
* @see https://docs.discord.com/developers/resources/emoji#create-guild-emoji-json-params
|
|
28
|
+
*/
|
|
29
|
+
export interface CreateGuildEmojiJSONParams {
|
|
30
|
+
/** name of the emoji */
|
|
31
|
+
name: string;
|
|
32
|
+
/** the 128x128 emoji image */
|
|
33
|
+
image: ImageData;
|
|
34
|
+
/** roles allowed to use this emoji */
|
|
35
|
+
roles: Snowflake[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* JSON Params
|
|
39
|
+
* @see https://docs.discord.com/developers/resources/emoji#modify-guild-emoji-json-params
|
|
40
|
+
*/
|
|
41
|
+
export interface ModifyGuildEmojiJSONParams {
|
|
42
|
+
/** name of the emoji */
|
|
43
|
+
name?: string;
|
|
44
|
+
/** roles allowed to use this emoji */
|
|
45
|
+
roles?: Snowflake[] | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* JSON Params
|
|
49
|
+
* @see https://docs.discord.com/developers/resources/emoji#create-application-emoji-json-params
|
|
50
|
+
*/
|
|
51
|
+
export interface CreateApplicationEmojiJSONParams {
|
|
52
|
+
/** name of the emoji */
|
|
53
|
+
name: string;
|
|
54
|
+
/** the 128x128 emoji image */
|
|
55
|
+
image: ImageData;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* JSON Params
|
|
59
|
+
* @see https://docs.discord.com/developers/resources/emoji#modify-application-emoji-json-params
|
|
60
|
+
*/
|
|
61
|
+
export interface ModifyApplicationEmojiJSONParams {
|
|
62
|
+
/** name of the emoji */
|
|
63
|
+
name?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* An emoji reduced to what identifies it: `id` is null for a standard
|
|
67
|
+
* (unicode) emoji, whose `name` is then the emoji itself.
|
|
68
|
+
* @see https://docs.discord.com/developers/resources/emoji#emoji-object
|
|
69
|
+
*/
|
|
70
|
+
export interface RawPartialEmoji {
|
|
71
|
+
id: Snowflake | null;
|
|
72
|
+
name: string | null;
|
|
73
|
+
animated?: boolean;
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ISO8601Timestamp, Snowflake } from './common.js';
|
|
2
|
+
/**
|
|
3
|
+
* Entitlement Structure
|
|
4
|
+
* @see https://docs.discord.com/developers/resources/entitlement#entitlement-object-entitlement-structure
|
|
5
|
+
*/
|
|
6
|
+
export interface RawEntitlement {
|
|
7
|
+
/** ID of the entitlement */
|
|
8
|
+
id: Snowflake;
|
|
9
|
+
/** ID of the SKU */
|
|
10
|
+
sku_id: Snowflake;
|
|
11
|
+
/** ID of the parent application */
|
|
12
|
+
application_id: Snowflake;
|
|
13
|
+
/** ID of the user that is granted access to the entitlement's sku */
|
|
14
|
+
user_id?: Snowflake;
|
|
15
|
+
/** Type of entitlement */
|
|
16
|
+
type: EntitlementType;
|
|
17
|
+
/** Entitlement was deleted */
|
|
18
|
+
deleted: boolean;
|
|
19
|
+
/** Start date at which the entitlement is valid. */
|
|
20
|
+
starts_at: ISO8601Timestamp | null;
|
|
21
|
+
/** Date at which the entitlement is no longer valid. */
|
|
22
|
+
ends_at: ISO8601Timestamp | null;
|
|
23
|
+
/** ID of the guild that is granted access to the entitlement's sku */
|
|
24
|
+
guild_id?: Snowflake;
|
|
25
|
+
/** For consumable items, whether or not the entitlement has been consumed */
|
|
26
|
+
consumed?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Entitlement Types
|
|
30
|
+
* @see https://docs.discord.com/developers/resources/entitlement#entitlement-object-entitlement-types
|
|
31
|
+
*/
|
|
32
|
+
export declare const EntitlementType: {
|
|
33
|
+
/** Entitlement was purchased by user */
|
|
34
|
+
readonly Purchase: 1;
|
|
35
|
+
/** Entitlement for Discord Nitro subscription */
|
|
36
|
+
readonly PremiumSubscription: 2;
|
|
37
|
+
/** Entitlement was gifted by developer */
|
|
38
|
+
readonly DeveloperGift: 3;
|
|
39
|
+
/** Entitlement was purchased by a dev in application test mode */
|
|
40
|
+
readonly TestModePurchase: 4;
|
|
41
|
+
/** Entitlement was granted when the SKU was free */
|
|
42
|
+
readonly FreePurchase: 5;
|
|
43
|
+
/** Entitlement was gifted by another user */
|
|
44
|
+
readonly UserGift: 6;
|
|
45
|
+
/** Entitlement was claimed by user for free as a Nitro Subscriber */
|
|
46
|
+
readonly PremiumPurchase: 7;
|
|
47
|
+
/** Entitlement was purchased as an app subscription */
|
|
48
|
+
readonly ApplicationSubscription: 8;
|
|
49
|
+
};
|
|
50
|
+
export type EntitlementType = (typeof EntitlementType)[keyof typeof EntitlementType];
|
|
51
|
+
/**
|
|
52
|
+
* Query String Params
|
|
53
|
+
* @see https://docs.discord.com/developers/resources/entitlement#list-entitlements-query-string-params
|
|
54
|
+
*/
|
|
55
|
+
export interface ListEntitlementsQuery {
|
|
56
|
+
/** User ID to look up entitlements for */
|
|
57
|
+
user_id?: Snowflake;
|
|
58
|
+
/** Optional list of SKU IDs to check entitlements for */
|
|
59
|
+
sku_ids?: string;
|
|
60
|
+
/** Retrieve entitlements before this entitlement ID */
|
|
61
|
+
before?: Snowflake;
|
|
62
|
+
/** Retrieve entitlements after this entitlement ID */
|
|
63
|
+
after?: Snowflake;
|
|
64
|
+
/** Number of entitlements to return, 1-100, default 100 */
|
|
65
|
+
limit?: number;
|
|
66
|
+
/** Guild ID to look up entitlements for */
|
|
67
|
+
guild_id?: Snowflake;
|
|
68
|
+
/** Whether or not ended entitlements should be omitted. Defaults to false, ended entitlements are included by default. */
|
|
69
|
+
exclude_ended?: boolean;
|
|
70
|
+
/** Whether or not deleted entitlements should be omitted. Defaults to true, deleted entitlements are not included by default. */
|
|
71
|
+
exclude_deleted?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* JSON Params
|
|
75
|
+
* @see https://docs.discord.com/developers/resources/entitlement#create-test-entitlement-json-params
|
|
76
|
+
*/
|
|
77
|
+
export interface CreateTestEntitlementJSONParams {
|
|
78
|
+
/** ID of the SKU to grant the entitlement to */
|
|
79
|
+
sku_id: string;
|
|
80
|
+
/** ID of the guild or user to grant the entitlement to */
|
|
81
|
+
owner_id: string;
|
|
82
|
+
/** `1` for a guild subscription, `2` for a user subscription */
|
|
83
|
+
owner_type: 1 | 2;
|
|
84
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entitlement Types
|
|
3
|
+
* @see https://docs.discord.com/developers/resources/entitlement#entitlement-object-entitlement-types
|
|
4
|
+
*/
|
|
5
|
+
export const EntitlementType = {
|
|
6
|
+
/** Entitlement was purchased by user */
|
|
7
|
+
Purchase: 1,
|
|
8
|
+
/** Entitlement for Discord Nitro subscription */
|
|
9
|
+
PremiumSubscription: 2,
|
|
10
|
+
/** Entitlement was gifted by developer */
|
|
11
|
+
DeveloperGift: 3,
|
|
12
|
+
/** Entitlement was purchased by a dev in application test mode */
|
|
13
|
+
TestModePurchase: 4,
|
|
14
|
+
/** Entitlement was granted when the SKU was free */
|
|
15
|
+
FreePurchase: 5,
|
|
16
|
+
/** Entitlement was gifted by another user */
|
|
17
|
+
UserGift: 6,
|
|
18
|
+
/** Entitlement was claimed by user for free as a Nitro Subscriber */
|
|
19
|
+
PremiumPurchase: 7,
|
|
20
|
+
/** Entitlement was purchased as an app subscription */
|
|
21
|
+
ApplicationSubscription: 8,
|
|
22
|
+
};
|