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,348 @@
|
|
|
1
|
+
import type { CacheStore } from '../cache/store.js';
|
|
2
|
+
import { type ImageOptions } from '../discord/cdn.js';
|
|
3
|
+
import { Permissions } from '../discord/permissions.js';
|
|
4
|
+
import type { GetGuildAuditLogQuery, RawAuditLog, RawAuditLogEntry } from '../discord/types/audit-log.js';
|
|
5
|
+
import type { RawAutoModerationRule } from '../discord/types/auto-moderation.js';
|
|
6
|
+
import type { Locale, Snowflake } from '../discord/types/common.js';
|
|
7
|
+
import type { RawGuildCreateExtra } from '../discord/types/gateway-events.js';
|
|
8
|
+
import type { CreateGuildScheduledEventJSONParams, RawGuildScheduledEvent } from '../discord/types/guild-scheduled-event.js';
|
|
9
|
+
import type { CreateGuildChannelJSONParams, CreateGuildRoleJSONParams, GuildFeature, ModifyGuildJSONParams, PremiumTier, RawGuild, VerificationLevel } from '../discord/types/guild.js';
|
|
10
|
+
import type { RawSticker } from '../discord/types/sticker.js';
|
|
11
|
+
import type { RawVoiceState } from '../discord/types/voice.js';
|
|
12
|
+
import { type Camelize } from '../util/case.js';
|
|
13
|
+
import { IdStructure } from './base.js';
|
|
14
|
+
import type { GuildChannel, ThreadChannel, VoiceChannel } from './channel.js';
|
|
15
|
+
import type { Context } from './context.js';
|
|
16
|
+
import type { GuildEmoji } from './emoji.js';
|
|
17
|
+
import type { Invite } from './invite.js';
|
|
18
|
+
import { type BanOptions, type GuildMember } from './member.js';
|
|
19
|
+
import type { Role } from './role.js';
|
|
20
|
+
import type { User } from './user.js';
|
|
21
|
+
import type { Webhook } from './webhook.js';
|
|
22
|
+
import type { VoiceConnection } from '../voice/connection.js';
|
|
23
|
+
/** What a server stores itself; its roles, emojis... live in its stores. */
|
|
24
|
+
export type GuildData = Omit<RawGuild, 'roles' | 'emojis' | 'stickers'> & Partial<Pick<RawGuildCreateExtra, 'joined_at' | 'large' | 'member_count'>> & {
|
|
25
|
+
unavailable?: boolean;
|
|
26
|
+
};
|
|
27
|
+
/** What belongs to a server: forgotten with it. */
|
|
28
|
+
export interface GuildStores {
|
|
29
|
+
roles: CacheStore<Snowflake, Role>;
|
|
30
|
+
members: CacheStore<Snowflake, GuildMember>;
|
|
31
|
+
channels: CacheStore<Snowflake, GuildChannel | ThreadChannel>;
|
|
32
|
+
emojis: CacheStore<Snowflake, GuildEmoji>;
|
|
33
|
+
/**
|
|
34
|
+
* Who is in a voice channel, by user id: what the voice events compare
|
|
35
|
+
* with. Only filled when Discord sends voice states, which is when a
|
|
36
|
+
* file listens to them.
|
|
37
|
+
*/
|
|
38
|
+
voiceStates: CacheStore<Snowflake, VoiceEntry>;
|
|
39
|
+
}
|
|
40
|
+
/** What the voice state of one person holds, without its member. */
|
|
41
|
+
export type VoiceStateData = Omit<RawVoiceState, 'member' | 'guild_id'>;
|
|
42
|
+
/** Someone in a voice channel: their state, and the channel they are in. */
|
|
43
|
+
export interface VoiceEntry {
|
|
44
|
+
state: VoiceStateData;
|
|
45
|
+
/** Kept with the state, so a channel deleted meanwhile is still known. */
|
|
46
|
+
channel: VoiceChannel;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Where someone is in voice, and how: muted, deafened, streaming...
|
|
50
|
+
* @see https://docs.discord.com/developers/resources/voice#voice-state-object
|
|
51
|
+
*/
|
|
52
|
+
export type VoiceState = Camelize<VoiceStateData>;
|
|
53
|
+
/** Only the framework writes to the stores of a server. */
|
|
54
|
+
export declare let storesOf: (guild: Guild) => GuildStores;
|
|
55
|
+
/**
|
|
56
|
+
* What `edit()` takes on a server: only what is passed changes. Images are
|
|
57
|
+
* data URIs (`data:image/png;base64,...`).
|
|
58
|
+
* @see https://docs.discord.com/developers/resources/guild#modify-guild-json-params
|
|
59
|
+
*/
|
|
60
|
+
export type GuildEditOptions = Camelize<ModifyGuildJSONParams>;
|
|
61
|
+
/**
|
|
62
|
+
* What `createChannel()` takes: a name, a type, and the settings of that
|
|
63
|
+
* kind of channel.
|
|
64
|
+
* @see https://docs.discord.com/developers/resources/guild#create-guild-channel-json-params
|
|
65
|
+
*/
|
|
66
|
+
export type ChannelCreateOptions = Camelize<CreateGuildChannelJSONParams>;
|
|
67
|
+
/**
|
|
68
|
+
* What `createRole()` takes. Permissions are given by name, as a list of
|
|
69
|
+
* names or as a `Permissions` set.
|
|
70
|
+
* @see https://docs.discord.com/developers/resources/guild#create-guild-role-json-params
|
|
71
|
+
*/
|
|
72
|
+
export type RoleCreateOptions = Camelize<Omit<CreateGuildRoleJSONParams, 'permissions'>> & {
|
|
73
|
+
permissions?: Permissions | ConstructorParameters<typeof Permissions>[0];
|
|
74
|
+
};
|
|
75
|
+
/** A ban of a server. */
|
|
76
|
+
export interface Ban {
|
|
77
|
+
/** Who is banned. */
|
|
78
|
+
user: User;
|
|
79
|
+
/** Why, when a reason was given. */
|
|
80
|
+
reason: string | null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* What moderators and bots did in a server: its entries, newest first, and
|
|
84
|
+
* what they refer to.
|
|
85
|
+
* @see https://docs.discord.com/developers/resources/audit-log#audit-log-object-audit-log-structure
|
|
86
|
+
*/
|
|
87
|
+
export type AuditLog = Camelize<RawAuditLog>;
|
|
88
|
+
/**
|
|
89
|
+
* One thing a moderator or a bot did in a server: what, by whom, on what,
|
|
90
|
+
* and what changed.
|
|
91
|
+
* @see https://docs.discord.com/developers/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
|
|
92
|
+
*/
|
|
93
|
+
export type AuditLogEntry = Camelize<RawAuditLogEntry>;
|
|
94
|
+
/**
|
|
95
|
+
* An event scheduled in a server: when it happens, where, and how often.
|
|
96
|
+
* @see https://docs.discord.com/developers/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
|
|
97
|
+
*/
|
|
98
|
+
export type ScheduledEvent = Camelize<RawGuildScheduledEvent>;
|
|
99
|
+
/**
|
|
100
|
+
* A rule Discord applies by itself to the messages of a server: what
|
|
101
|
+
* triggers it, and what it does then.
|
|
102
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure
|
|
103
|
+
*/
|
|
104
|
+
export type AutoModerationRule = Camelize<RawAutoModerationRule>;
|
|
105
|
+
/**
|
|
106
|
+
* A sticker: one of a server, or a standard one from a pack.
|
|
107
|
+
* @see https://docs.discord.com/developers/resources/sticker#sticker-object-sticker-structure
|
|
108
|
+
*/
|
|
109
|
+
export type Sticker = Camelize<RawSticker>;
|
|
110
|
+
/**
|
|
111
|
+
* A server ("guild" is the name Discord gives servers in its API).
|
|
112
|
+
* @see https://docs.discord.com/developers/resources/guild#guild-object
|
|
113
|
+
*/
|
|
114
|
+
export declare class Guild extends IdStructure<GuildData> {
|
|
115
|
+
#private;
|
|
116
|
+
constructor(ctx: Context, data: GuildData);
|
|
117
|
+
/** The name of the server. */
|
|
118
|
+
get name(): string;
|
|
119
|
+
/** The description of the server, when it has one. */
|
|
120
|
+
get description(): string | null;
|
|
121
|
+
/** The id of the user who owns the server. */
|
|
122
|
+
get ownerId(): Snowflake;
|
|
123
|
+
/** `false` during an outage of Discord: the data may be out of date. */
|
|
124
|
+
get available(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* How many members the server has. Exact when the bot receives member
|
|
127
|
+
* events, approximate otherwise; `null` when Discord never said it.
|
|
128
|
+
*/
|
|
129
|
+
get memberCount(): number | null;
|
|
130
|
+
/**
|
|
131
|
+
* What the server has enabled or unlocked (`COMMUNITY`, `VANITY_URL`...).
|
|
132
|
+
* @see https://docs.discord.com/developers/resources/guild#guild-object-guild-features
|
|
133
|
+
*/
|
|
134
|
+
get features(): readonly GuildFeature[];
|
|
135
|
+
/** What Discord asks of new members before they can write. */
|
|
136
|
+
get verificationLevel(): VerificationLevel;
|
|
137
|
+
/** The boost level of the server. */
|
|
138
|
+
get premiumTier(): PremiumTier;
|
|
139
|
+
/** How many boosts the server has. */
|
|
140
|
+
get boostCount(): number;
|
|
141
|
+
/** The language of the server, used for what Discord sends to it. */
|
|
142
|
+
get preferredLocale(): Locale;
|
|
143
|
+
/** The code of the custom invite link of the server, when it has one. */
|
|
144
|
+
get vanityUrlCode(): string | null;
|
|
145
|
+
/** The id of the channel where Discord posts welcome messages. */
|
|
146
|
+
get systemChannelId(): Snowflake | null;
|
|
147
|
+
/** The id of the channel that shows the rules, in a community server. */
|
|
148
|
+
get rulesChannelId(): Snowflake | null;
|
|
149
|
+
/** The id of the voice channel inactive members are moved to. */
|
|
150
|
+
get afkChannelId(): Snowflake | null;
|
|
151
|
+
/** When the bot joined the server, when Discord said it. */
|
|
152
|
+
get joinedAt(): Date | null;
|
|
153
|
+
/** The roles of the server, @everyone included. */
|
|
154
|
+
get roles(): ReadonlyMap<Snowflake, Role>;
|
|
155
|
+
/**
|
|
156
|
+
* The members of the server the bot knows: the ones seen the most
|
|
157
|
+
* recently, not all of them.
|
|
158
|
+
*/
|
|
159
|
+
get members(): ReadonlyMap<Snowflake, GuildMember>;
|
|
160
|
+
/** The channels and active threads of the server. */
|
|
161
|
+
get channels(): ReadonlyMap<Snowflake, GuildChannel | ThreadChannel>;
|
|
162
|
+
/** The custom emojis of the server. */
|
|
163
|
+
get emojis(): ReadonlyMap<Snowflake, GuildEmoji>;
|
|
164
|
+
/**
|
|
165
|
+
* The bot in voice in this server, to play or leave; `null` when it is
|
|
166
|
+
* in no voice channel here.
|
|
167
|
+
*/
|
|
168
|
+
get voice(): VoiceConnection | null;
|
|
169
|
+
/** The @everyone role, which every member has. */
|
|
170
|
+
get everyoneRole(): Role;
|
|
171
|
+
/** The bot as a member of this server. */
|
|
172
|
+
get me(): GuildMember;
|
|
173
|
+
/** The URL of the icon of the server, when it has one. */
|
|
174
|
+
iconURL(options?: ImageOptions): string | null;
|
|
175
|
+
/** The URL of the banner of the server, when it has one. */
|
|
176
|
+
bannerURL(options?: ImageOptions): string | null;
|
|
177
|
+
/** The URL of the invite background of the server, when it has one. */
|
|
178
|
+
splashURL(options?: ImageOptions): string | null;
|
|
179
|
+
/**
|
|
180
|
+
* Asks Discord for the latest data of the server.
|
|
181
|
+
* @see https://docs.discord.com/developers/resources/guild#get-guild
|
|
182
|
+
*/
|
|
183
|
+
fetch(): Promise<Guild>;
|
|
184
|
+
/**
|
|
185
|
+
* Changes the settings of the server.
|
|
186
|
+
* @see https://docs.discord.com/developers/resources/guild#modify-guild
|
|
187
|
+
*/
|
|
188
|
+
edit(options: GuildEditOptions, reason?: string): Promise<Guild>;
|
|
189
|
+
/**
|
|
190
|
+
* Makes the bot leave the server.
|
|
191
|
+
* @see https://docs.discord.com/developers/resources/user#leave-guild
|
|
192
|
+
*/
|
|
193
|
+
leave(): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* A member of the server: from what the bot remembers, or else from Discord.
|
|
196
|
+
* @see https://docs.discord.com/developers/resources/guild#get-guild-member
|
|
197
|
+
*/
|
|
198
|
+
fetchMember(user: Snowflake | {
|
|
199
|
+
id: Snowflake;
|
|
200
|
+
}, { force }?: {
|
|
201
|
+
force?: boolean;
|
|
202
|
+
}): Promise<GuildMember>;
|
|
203
|
+
/**
|
|
204
|
+
* Members of the server, by pages of 1000 at most, ordered by id. Needs
|
|
205
|
+
* the Server Members intent to be enabled for the bot.
|
|
206
|
+
* @see https://docs.discord.com/developers/resources/guild#list-guild-members
|
|
207
|
+
*/
|
|
208
|
+
fetchMembers(options?: {
|
|
209
|
+
limit?: number;
|
|
210
|
+
after?: Snowflake | {
|
|
211
|
+
id: Snowflake;
|
|
212
|
+
};
|
|
213
|
+
}): Promise<GuildMember[]>;
|
|
214
|
+
/**
|
|
215
|
+
* Members whose username or nickname starts with the given text.
|
|
216
|
+
* @see https://docs.discord.com/developers/resources/guild#search-guild-members
|
|
217
|
+
*/
|
|
218
|
+
searchMembers(query: string, limit?: number): Promise<GuildMember[]>;
|
|
219
|
+
/** The member who owns the server. */
|
|
220
|
+
fetchOwner(): Promise<GuildMember>;
|
|
221
|
+
/**
|
|
222
|
+
* Removes a member from the server; they can come back with an invite.
|
|
223
|
+
* @see https://docs.discord.com/developers/resources/guild#remove-guild-member
|
|
224
|
+
*/
|
|
225
|
+
kick(user: Snowflake | {
|
|
226
|
+
id: Snowflake;
|
|
227
|
+
}, reason?: string): Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Bans a user from the server, member or not.
|
|
230
|
+
* @see https://docs.discord.com/developers/resources/guild#create-guild-ban
|
|
231
|
+
*/
|
|
232
|
+
ban(user: Snowflake | {
|
|
233
|
+
id: Snowflake;
|
|
234
|
+
}, options?: BanOptions): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Bans up to 200 users at once.
|
|
237
|
+
* @returns the ids of the users that were banned, and of those that could not be
|
|
238
|
+
* @see https://docs.discord.com/developers/resources/guild#bulk-guild-ban
|
|
239
|
+
*/
|
|
240
|
+
bulkBan(users: readonly (Snowflake | {
|
|
241
|
+
id: Snowflake;
|
|
242
|
+
})[], options?: BanOptions): Promise<{
|
|
243
|
+
bannedUsers: Snowflake[];
|
|
244
|
+
failedUsers: Snowflake[];
|
|
245
|
+
}>;
|
|
246
|
+
/**
|
|
247
|
+
* Lifts the ban of a user.
|
|
248
|
+
* @see https://docs.discord.com/developers/resources/guild#remove-guild-ban
|
|
249
|
+
*/
|
|
250
|
+
unban(user: Snowflake | {
|
|
251
|
+
id: Snowflake;
|
|
252
|
+
}, reason?: string): Promise<void>;
|
|
253
|
+
/**
|
|
254
|
+
* The ban of a user; `null` when they are not banned.
|
|
255
|
+
* @see https://docs.discord.com/developers/resources/guild#get-guild-ban
|
|
256
|
+
*/
|
|
257
|
+
fetchBan(user: Snowflake | {
|
|
258
|
+
id: Snowflake;
|
|
259
|
+
}): Promise<Ban | null>;
|
|
260
|
+
/**
|
|
261
|
+
* The bans of the server, by pages of 1000 at most.
|
|
262
|
+
* @see https://docs.discord.com/developers/resources/guild#get-guild-bans
|
|
263
|
+
*/
|
|
264
|
+
fetchBans(options?: {
|
|
265
|
+
limit?: number;
|
|
266
|
+
before?: Snowflake;
|
|
267
|
+
after?: Snowflake;
|
|
268
|
+
}): Promise<Ban[]>;
|
|
269
|
+
/**
|
|
270
|
+
* Asks Discord for the roles of the server.
|
|
271
|
+
* @see https://docs.discord.com/developers/resources/guild#get-guild-roles
|
|
272
|
+
*/
|
|
273
|
+
fetchRoles(): Promise<Role[]>;
|
|
274
|
+
/**
|
|
275
|
+
* Creates a role.
|
|
276
|
+
* @see https://docs.discord.com/developers/resources/guild#create-guild-role
|
|
277
|
+
*/
|
|
278
|
+
createRole(options?: RoleCreateOptions, reason?: string): Promise<Role>;
|
|
279
|
+
/**
|
|
280
|
+
* The channels of the server (threads are not included).
|
|
281
|
+
* @see https://docs.discord.com/developers/resources/guild#get-guild-channels
|
|
282
|
+
*/
|
|
283
|
+
fetchChannels(): Promise<GuildChannel[]>;
|
|
284
|
+
/**
|
|
285
|
+
* Creates a channel.
|
|
286
|
+
* @see https://docs.discord.com/developers/resources/guild#create-guild-channel
|
|
287
|
+
*/
|
|
288
|
+
createChannel(options: ChannelCreateOptions, reason?: string): Promise<GuildChannel>;
|
|
289
|
+
/**
|
|
290
|
+
* The threads of the server that are not archived.
|
|
291
|
+
* @see https://docs.discord.com/developers/resources/guild#list-active-guild-threads
|
|
292
|
+
*/
|
|
293
|
+
fetchActiveThreads(): Promise<ThreadChannel[]>;
|
|
294
|
+
/**
|
|
295
|
+
* Asks Discord for the custom emojis of the server.
|
|
296
|
+
* @see https://docs.discord.com/developers/resources/emoji#list-guild-emojis
|
|
297
|
+
*/
|
|
298
|
+
fetchEmojis(): Promise<GuildEmoji[]>;
|
|
299
|
+
/**
|
|
300
|
+
* Adds a custom emoji to the server.
|
|
301
|
+
* @param options.image the image as a data URI (`data:image/png;base64,...`)
|
|
302
|
+
* @see https://docs.discord.com/developers/resources/emoji#create-guild-emoji
|
|
303
|
+
*/
|
|
304
|
+
createEmoji(options: {
|
|
305
|
+
name: string;
|
|
306
|
+
image: string;
|
|
307
|
+
roles?: (Snowflake | {
|
|
308
|
+
id: Snowflake;
|
|
309
|
+
})[];
|
|
310
|
+
}, reason?: string): Promise<GuildEmoji>;
|
|
311
|
+
/**
|
|
312
|
+
* The invites of the server, with how many times each was used.
|
|
313
|
+
* @see https://docs.discord.com/developers/resources/guild#get-guild-invites
|
|
314
|
+
*/
|
|
315
|
+
fetchInvites(): Promise<Invite[]>;
|
|
316
|
+
/**
|
|
317
|
+
* The webhooks of every channel of the server.
|
|
318
|
+
* @see https://docs.discord.com/developers/resources/webhook#get-guild-webhooks
|
|
319
|
+
*/
|
|
320
|
+
fetchWebhooks(): Promise<Webhook[]>;
|
|
321
|
+
/**
|
|
322
|
+
* What moderators and bots did in the server.
|
|
323
|
+
* @see https://docs.discord.com/developers/resources/audit-log#get-guild-audit-log
|
|
324
|
+
*/
|
|
325
|
+
fetchAuditLog(options?: Camelize<GetGuildAuditLogQuery>): Promise<AuditLog>;
|
|
326
|
+
/**
|
|
327
|
+
* The scheduled events of the server.
|
|
328
|
+
* @see https://docs.discord.com/developers/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
|
329
|
+
*/
|
|
330
|
+
fetchScheduledEvents(): Promise<ScheduledEvent[]>;
|
|
331
|
+
/**
|
|
332
|
+
* Schedules an event in the server.
|
|
333
|
+
* @see https://docs.discord.com/developers/resources/guild-scheduled-event#create-guild-scheduled-event
|
|
334
|
+
*/
|
|
335
|
+
createScheduledEvent(options: Camelize<CreateGuildScheduledEventJSONParams>, reason?: string): Promise<ScheduledEvent>;
|
|
336
|
+
/**
|
|
337
|
+
* The auto moderation rules of the server.
|
|
338
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
|
339
|
+
*/
|
|
340
|
+
fetchAutoModerationRules(): Promise<AutoModerationRule[]>;
|
|
341
|
+
/**
|
|
342
|
+
* The custom stickers of the server.
|
|
343
|
+
* @see https://docs.discord.com/developers/resources/sticker#list-guild-stickers
|
|
344
|
+
*/
|
|
345
|
+
fetchStickers(): Promise<Sticker[]>;
|
|
346
|
+
/** The name of the server. */
|
|
347
|
+
toString(): string;
|
|
348
|
+
}
|