oceanic.js 1.10.3-dev.c6c9f52 → 1.10.3-dev0.4d73673
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/lib/Client.d.ts +97 -0
- package/dist/lib/Client.js +261 -0
- package/dist/lib/Constants.d.ts +1210 -0
- package/dist/lib/Constants.js +1509 -0
- package/dist/lib/gateway/Shard.d.ts +77 -0
- package/dist/lib/gateway/Shard.js +1621 -0
- package/dist/lib/gateway/ShardManager.d.ts +26 -0
- package/dist/lib/gateway/ShardManager.js +300 -0
- package/dist/lib/index.d.ts +84 -0
- package/dist/lib/index.js +168 -0
- package/dist/lib/rest/Bucket.d.ts +33 -0
- package/dist/lib/rest/Bucket.js +78 -0
- package/dist/lib/rest/DiscordHTTPError.d.ts +16 -0
- package/dist/lib/rest/DiscordHTTPError.js +65 -0
- package/dist/lib/rest/DiscordRESTError.d.ts +19 -0
- package/dist/lib/rest/DiscordRESTError.js +89 -0
- package/dist/lib/rest/OAuthHelper.d.ts +61 -0
- package/dist/lib/rest/OAuthHelper.js +183 -0
- package/dist/lib/rest/RESTManager.d.ts +42 -0
- package/dist/lib/rest/RESTManager.js +82 -0
- package/dist/lib/rest/RequestHandler.d.ts +28 -0
- package/dist/lib/rest/RequestHandler.js +313 -0
- package/dist/lib/rest/SequentialBucket.d.ts +25 -0
- package/dist/lib/rest/SequentialBucket.js +76 -0
- package/dist/lib/routes/Applications.d.ts +171 -0
- package/dist/lib/routes/Applications.js +447 -0
- package/dist/lib/routes/Channels.d.ts +408 -0
- package/dist/lib/routes/Channels.js +1160 -0
- package/dist/lib/routes/Guilds.d.ts +606 -0
- package/dist/lib/routes/Guilds.js +1669 -0
- package/dist/lib/routes/Interactions.d.ts +74 -0
- package/dist/lib/routes/Interactions.js +141 -0
- package/dist/lib/routes/Miscellaneous.d.ts +31 -0
- package/dist/lib/routes/Miscellaneous.js +69 -0
- package/dist/lib/routes/OAuth.d.ts +105 -0
- package/dist/lib/routes/OAuth.js +309 -0
- package/dist/lib/routes/Users.d.ts +32 -0
- package/dist/lib/routes/Users.js +59 -0
- package/dist/lib/routes/Webhooks.d.ts +128 -0
- package/dist/lib/routes/Webhooks.js +265 -0
- package/dist/lib/structures/AnnouncementChannel.d.ts +36 -0
- package/dist/lib/structures/AnnouncementChannel.js +47 -0
- package/dist/lib/structures/AnnouncementThreadChannel.d.ts +18 -0
- package/dist/lib/structures/AnnouncementThreadChannel.js +27 -0
- package/dist/lib/structures/Application.d.ts +102 -0
- package/dist/lib/structures/Application.js +189 -0
- package/dist/lib/structures/ApplicationCommand.d.ts +74 -0
- package/dist/lib/structures/ApplicationCommand.js +141 -0
- package/dist/lib/structures/Attachment.d.ts +34 -0
- package/dist/lib/structures/Attachment.js +64 -0
- package/dist/lib/structures/AuditLogEntry.d.ts +25 -0
- package/dist/lib/structures/AuditLogEntry.js +53 -0
- package/dist/lib/structures/AutoModerationRule.d.ts +49 -0
- package/dist/lib/structures/AutoModerationRule.js +139 -0
- package/dist/lib/structures/AutocompleteInteraction.d.ts +62 -0
- package/dist/lib/structures/AutocompleteInteraction.js +115 -0
- package/dist/lib/structures/Base.d.ts +20 -0
- package/dist/lib/structures/Base.js +58 -0
- package/dist/lib/structures/BaseEntitlement.d.ts +19 -0
- package/dist/lib/structures/BaseEntitlement.js +44 -0
- package/dist/lib/structures/CategoryChannel.d.ts +41 -0
- package/dist/lib/structures/CategoryChannel.js +105 -0
- package/dist/lib/structures/Channel.d.ts +20 -0
- package/dist/lib/structures/Channel.js +91 -0
- package/dist/lib/structures/ClientApplication.d.ts +153 -0
- package/dist/lib/structures/ClientApplication.js +220 -0
- package/dist/lib/structures/CommandInteraction.d.ts +127 -0
- package/dist/lib/structures/CommandInteraction.js +297 -0
- package/dist/lib/structures/ComponentInteraction.d.ts +137 -0
- package/dist/lib/structures/ComponentInteraction.js +311 -0
- package/dist/lib/structures/Entitlement.d.ts +12 -0
- package/dist/lib/structures/Entitlement.js +26 -0
- package/dist/lib/structures/ExtendedUser.d.ts +26 -0
- package/dist/lib/structures/ExtendedUser.js +57 -0
- package/dist/lib/structures/ForumChannel.d.ts +11 -0
- package/dist/lib/structures/ForumChannel.js +19 -0
- package/dist/lib/structures/GroupChannel.d.ts +62 -0
- package/dist/lib/structures/GroupChannel.js +133 -0
- package/dist/lib/structures/Guild.d.ts +654 -0
- package/dist/lib/structures/Guild.js +1319 -0
- package/dist/lib/structures/GuildChannel.d.ts +34 -0
- package/dist/lib/structures/GuildChannel.js +75 -0
- package/dist/lib/structures/GuildPreview.d.ts +50 -0
- package/dist/lib/structures/GuildPreview.js +119 -0
- package/dist/lib/structures/GuildScheduledEvent.d.ts +60 -0
- package/dist/lib/structures/GuildScheduledEvent.js +154 -0
- package/dist/lib/structures/GuildTemplate.d.ts +55 -0
- package/dist/lib/structures/GuildTemplate.js +126 -0
- package/dist/lib/structures/Integration.d.ts +54 -0
- package/dist/lib/structures/Integration.js +156 -0
- package/dist/lib/structures/Interaction.d.ts +40 -0
- package/dist/lib/structures/Interaction.js +90 -0
- package/dist/lib/structures/InteractionResolvedChannel.d.ts +28 -0
- package/dist/lib/structures/InteractionResolvedChannel.js +45 -0
- package/dist/lib/structures/Invite.d.ts +64 -0
- package/dist/lib/structures/Invite.js +193 -0
- package/dist/lib/structures/InviteGuild.d.ts +52 -0
- package/dist/lib/structures/InviteGuild.js +88 -0
- package/dist/lib/structures/MediaChannel.d.ts +11 -0
- package/dist/lib/structures/MediaChannel.js +19 -0
- package/dist/lib/structures/Member.d.ts +122 -0
- package/dist/lib/structures/Member.js +255 -0
- package/dist/lib/structures/Message.d.ts +194 -0
- package/dist/lib/structures/Message.js +477 -0
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +128 -0
- package/dist/lib/structures/ModalSubmitInteraction.js +240 -0
- package/dist/lib/structures/OAuthApplication.d.ts +79 -0
- package/dist/lib/structures/OAuthApplication.js +210 -0
- package/dist/lib/structures/OAuthGuild.d.ts +35 -0
- package/dist/lib/structures/OAuthGuild.js +61 -0
- package/dist/lib/structures/PartialApplication.d.ts +30 -0
- package/dist/lib/structures/PartialApplication.js +67 -0
- package/dist/lib/structures/Permission.d.ts +21 -0
- package/dist/lib/structures/Permission.js +68 -0
- package/dist/lib/structures/PermissionOverwrite.d.ts +26 -0
- package/dist/lib/structures/PermissionOverwrite.js +49 -0
- package/dist/lib/structures/PingInteraction.d.ts +16 -0
- package/dist/lib/structures/PingInteraction.js +26 -0
- package/dist/lib/structures/Poll.d.ts +28 -0
- package/dist/lib/structures/Poll.js +78 -0
- package/dist/lib/structures/PrivateChannel.d.ts +90 -0
- package/dist/lib/structures/PrivateChannel.js +131 -0
- package/dist/lib/structures/PrivateThreadChannel.d.ts +18 -0
- package/dist/lib/structures/PrivateThreadChannel.js +27 -0
- package/dist/lib/structures/PublicThreadChannel.d.ts +21 -0
- package/dist/lib/structures/PublicThreadChannel.js +37 -0
- package/dist/lib/structures/Role.d.ts +50 -0
- package/dist/lib/structures/Role.js +131 -0
- package/dist/lib/structures/SKU.d.ts +32 -0
- package/dist/lib/structures/SKU.js +53 -0
- package/dist/lib/structures/StageChannel.d.ts +33 -0
- package/dist/lib/structures/StageChannel.js +44 -0
- package/dist/lib/structures/StageInstance.d.ts +36 -0
- package/dist/lib/structures/StageInstance.js +94 -0
- package/dist/lib/structures/Team.d.ts +22 -0
- package/dist/lib/structures/Team.js +67 -0
- package/dist/lib/structures/TestEntitlement.d.ts +10 -0
- package/dist/lib/structures/TestEntitlement.js +21 -0
- package/dist/lib/structures/TextChannel.d.ts +34 -0
- package/dist/lib/structures/TextChannel.js +46 -0
- package/dist/lib/structures/TextableChannel.d.ts +158 -0
- package/dist/lib/structures/TextableChannel.js +276 -0
- package/dist/lib/structures/TextableVoiceChannel.d.ts +39 -0
- package/dist/lib/structures/TextableVoiceChannel.js +81 -0
- package/dist/lib/structures/ThreadChannel.d.ts +159 -0
- package/dist/lib/structures/ThreadChannel.js +295 -0
- package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
- package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
- package/dist/lib/structures/ThreadableChannel.d.ts +36 -0
- package/dist/lib/structures/ThreadableChannel.js +58 -0
- package/dist/lib/structures/UnavailableGuild.d.ts +11 -0
- package/dist/lib/structures/UnavailableGuild.js +21 -0
- package/dist/lib/structures/User.d.ts +82 -0
- package/dist/lib/structures/User.js +168 -0
- package/dist/lib/structures/VoiceChannel.d.ts +20 -0
- package/dist/lib/structures/VoiceChannel.js +35 -0
- package/dist/lib/structures/VoiceState.d.ts +51 -0
- package/dist/lib/structures/VoiceState.js +140 -0
- package/dist/lib/structures/Webhook.d.ts +129 -0
- package/dist/lib/structures/Webhook.js +206 -0
- package/dist/lib/types/applications.d.ts +466 -0
- package/dist/lib/types/audit-log.d.ts +121 -0
- package/dist/lib/types/auto-moderation.d.ts +99 -0
- package/dist/lib/types/channels.d.ts +1244 -0
- package/dist/lib/types/client.d.ts +228 -0
- package/dist/lib/types/events.d.ts +265 -0
- package/dist/lib/types/gateway-raw.d.ts +584 -0
- package/dist/lib/types/gateway.d.ts +351 -0
- package/dist/lib/types/guild-template.d.ts +33 -0
- package/dist/lib/types/guilds.d.ts +854 -0
- package/dist/lib/types/index.d.ts +18 -0
- package/dist/lib/types/interactions.d.ts +377 -0
- package/dist/lib/types/json.d.ts +742 -0
- package/dist/lib/types/misc.d.ts +28 -0
- package/dist/lib/types/oauth.d.ts +201 -0
- package/dist/lib/types/request-handler.d.ts +52 -0
- package/dist/lib/types/scheduled-events.d.ts +88 -0
- package/dist/lib/types/shared.d.ts +9 -0
- package/dist/lib/types/users.d.ts +45 -0
- package/dist/lib/types/voice.d.ts +45 -0
- package/dist/lib/types/webhooks.d.ts +74 -0
- package/dist/lib/util/Collection.d.ts +47 -0
- package/dist/lib/util/Collection.js +78 -0
- package/dist/lib/util/Errors.d.ts +29 -0
- package/dist/lib/util/Errors.js +56 -0
- package/dist/lib/util/Routes.d.ts +127 -0
- package/dist/lib/util/Routes.js +248 -0
- package/dist/lib/util/SimpleCollection.d.ts +12 -0
- package/dist/lib/util/SimpleCollection.js +81 -0
- package/dist/lib/util/TypedCollection.d.ts +24 -0
- package/dist/lib/util/TypedCollection.js +76 -0
- package/dist/lib/util/TypedEmitter.d.ts +19 -0
- package/dist/lib/util/TypedEmitter.js +19 -0
- package/dist/lib/util/Util.d.ts +58 -0
- package/dist/lib/util/Util.js +535 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.js +213 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +24 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.js +28 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +24 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +34 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +60 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +124 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,1244 @@
|
|
|
1
|
+
/** @module Types/Channels */
|
|
2
|
+
import type { NullablePartialEmoji, PartialEmoji, RawInviteGuild, RawMember } from "./guilds";
|
|
3
|
+
import type { RawApplication, RawPartialApplication } from "./applications";
|
|
4
|
+
import type { RawUser, RawUserWithMember } from "./users";
|
|
5
|
+
import type { File } from "./request-handler";
|
|
6
|
+
import type { RawScheduledEvent } from "./scheduled-events";
|
|
7
|
+
import { type Uncached } from "./shared";
|
|
8
|
+
import type { AuthorizingIntegrationOwners, SelectMenuDefaultValue } from "./interactions";
|
|
9
|
+
import type { Nullable } from "./misc";
|
|
10
|
+
import type {
|
|
11
|
+
ButtonStyles,
|
|
12
|
+
ChannelTypes,
|
|
13
|
+
ComponentTypes,
|
|
14
|
+
InteractionTypes,
|
|
15
|
+
InviteTargetTypes,
|
|
16
|
+
MessageActivityTypes,
|
|
17
|
+
MessageTypes,
|
|
18
|
+
OverwriteTypes,
|
|
19
|
+
SelectMenuTypes,
|
|
20
|
+
SortOrderTypes,
|
|
21
|
+
StickerFormatTypes,
|
|
22
|
+
TextInputStyles,
|
|
23
|
+
ThreadAutoArchiveDuration,
|
|
24
|
+
VideoQualityModes,
|
|
25
|
+
ForumLayoutTypes,
|
|
26
|
+
ChannelTypeMap,
|
|
27
|
+
PrivateChannelTypes,
|
|
28
|
+
NotImplementedChannelTypes,
|
|
29
|
+
GuildChannelTypes,
|
|
30
|
+
ThreadChannelTypes,
|
|
31
|
+
GuildChannelsWithoutThreadsTypes,
|
|
32
|
+
EditableChannelTypes,
|
|
33
|
+
TextableChannelTypes,
|
|
34
|
+
TextableGuildChannelTypes,
|
|
35
|
+
TextableChannelsWithoutThreadsTypes,
|
|
36
|
+
TextableGuildChannelsWithoutThreadsTypes,
|
|
37
|
+
VoiceChannelTypes,
|
|
38
|
+
InteractionChannelTypes,
|
|
39
|
+
InviteChannelTypes,
|
|
40
|
+
ImplementedChannelTypes,
|
|
41
|
+
ThreadOnlyChannelTypes,
|
|
42
|
+
ReactionType,
|
|
43
|
+
PollLayoutType
|
|
44
|
+
} from "../Constants";
|
|
45
|
+
import type Member from "../structures/Member";
|
|
46
|
+
import type AnnouncementChannel from "../structures/AnnouncementChannel";
|
|
47
|
+
import type AnnouncementThreadChannel from "../structures/AnnouncementThreadChannel";
|
|
48
|
+
import type PrivateThreadChannel from "../structures/PrivateThreadChannel";
|
|
49
|
+
import type PublicThreadChannel from "../structures/PublicThreadChannel";
|
|
50
|
+
import type TextChannel from "../structures/TextChannel";
|
|
51
|
+
import type User from "../structures/User";
|
|
52
|
+
import type ForumChannel from "../structures/ForumChannel";
|
|
53
|
+
import type Message from "../structures/Message";
|
|
54
|
+
import type Guild from "../structures/Guild";
|
|
55
|
+
import type Invite from "../structures/Invite";
|
|
56
|
+
|
|
57
|
+
export interface RawChannel {
|
|
58
|
+
application_id?: string;
|
|
59
|
+
applied_tags?: Array<string>;
|
|
60
|
+
available_tags?: Array<RawForumTag>;
|
|
61
|
+
bitrate?: number;
|
|
62
|
+
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
|
63
|
+
default_forum_layout?: ForumLayoutTypes;
|
|
64
|
+
default_reaction_emoji?: {
|
|
65
|
+
emoji_id: string | null;
|
|
66
|
+
emoji_name: string | null;
|
|
67
|
+
} | null;
|
|
68
|
+
default_sort_order?: SortOrderTypes | null;
|
|
69
|
+
default_thread_rate_limit_per_user?: number;
|
|
70
|
+
flags?: number;
|
|
71
|
+
guild_id?: string;
|
|
72
|
+
icon?: string | null;
|
|
73
|
+
id: string;
|
|
74
|
+
last_message_id?: string | null;
|
|
75
|
+
last_pin_timestamp?: string | null;
|
|
76
|
+
managed?: boolean;
|
|
77
|
+
member?: RawChannelThreadMember;
|
|
78
|
+
member_count?: number;
|
|
79
|
+
message_count?: number;
|
|
80
|
+
name?: string | null;
|
|
81
|
+
newly_created?: boolean;
|
|
82
|
+
nsfw?: boolean;
|
|
83
|
+
owner_id?: string;
|
|
84
|
+
parent_id?: string | null;
|
|
85
|
+
permission_overwrites?: Array<RawOverwrite>;
|
|
86
|
+
permissions?: string;
|
|
87
|
+
position?: number;
|
|
88
|
+
rate_limit_per_user?: number;
|
|
89
|
+
recipients?: Array<RawUser>;
|
|
90
|
+
rtc_region?: string | null;
|
|
91
|
+
status?: string | null;
|
|
92
|
+
thread_metadata?: RawThreadMetadata;
|
|
93
|
+
topic?: string | null;
|
|
94
|
+
total_message_sent?: number;
|
|
95
|
+
type: ChannelTypes;
|
|
96
|
+
user_limit?: number;
|
|
97
|
+
video_quality_mode?: VideoQualityModes;
|
|
98
|
+
}
|
|
99
|
+
export interface RawGuildChannel extends Required<Pick<RawChannel, "id" | "guild_id" | "parent_id">> { name: string; type: GuildChannels; }
|
|
100
|
+
export interface RawPrivateChannel extends Required<Pick<RawChannel, "id" | "last_message_id" | "recipients">> { type: ChannelTypes.DM; }
|
|
101
|
+
// nicks is undocumented, creating a group dm DOES work, and they show in the client, so we're supporting them
|
|
102
|
+
export interface RawGroupChannel extends Required<Pick<RawChannel, "id" | "recipients" | "application_id" | "icon" | "owner_id" | "nsfw" | "last_message_id">> { managed: boolean; name: string; nicks?: Array<Record<"id" | "nick", string>>; type: ChannelTypes.GROUP_DM; }
|
|
103
|
+
export interface RawTextChannel extends Omit<RawGuildChannel, "type">, Required<Pick<RawChannel, "default_auto_archive_duration" | "last_message_id" | "last_pin_timestamp" | "rate_limit_per_user" | "topic" | "nsfw" | "permission_overwrites" | "position">> { type: ChannelTypes.GUILD_TEXT; }
|
|
104
|
+
export interface RawCategoryChannel extends Omit<RawGuildChannel, "type">, Required<Pick<RawChannel, "permission_overwrites" | "position">> { type: ChannelTypes.GUILD_CATEGORY; }
|
|
105
|
+
export interface RawAnnouncementChannel extends Omit<RawTextChannel, "type"> { type: ChannelTypes.GUILD_ANNOUNCEMENT; }
|
|
106
|
+
export interface RawVoiceChannel extends Omit<RawGuildChannel, "type">, Required<Pick<RawChannel, "bitrate" | "user_limit" | "video_quality_mode" | "rtc_region" | "nsfw" | "topic" | "permission_overwrites" | "position" | "last_message_id" | "rate_limit_per_user" | "status">> { type: ChannelTypes.GUILD_VOICE; }
|
|
107
|
+
export interface RawStageChannel extends Omit<RawVoiceChannel, "type"> { type: ChannelTypes.GUILD_STAGE_VOICE; }
|
|
108
|
+
export type RawThreadChannel = RawAnnouncementThreadChannel | RawPublicThreadChannel | RawPrivateThreadChannel;
|
|
109
|
+
export interface RawAnnouncementThreadChannel extends Required<Pick<RawChannel, "id" | "guild_id" | "parent_id" | "owner_id" | "last_message_id" | "thread_metadata" | "message_count" | "member_count" | "rate_limit_per_user" | "flags" | "total_message_sent" | "newly_created" | "member">> { name: string; type: ChannelTypes.ANNOUNCEMENT_THREAD; }
|
|
110
|
+
export interface RawPublicThreadChannel extends Omit<RawAnnouncementThreadChannel, "type">, Required<Pick<RawChannel, "applied_tags">> { type: ChannelTypes.PUBLIC_THREAD; }
|
|
111
|
+
export interface RawPrivateThreadChannel extends Omit<RawAnnouncementThreadChannel, "type" | "member"> { member: RawChannel["member"]; type: ChannelTypes.PRIVATE_THREAD; }
|
|
112
|
+
export interface RawThreadOnlyChannel extends Omit<RawGuildChannel, "type">, Required<Pick<RawChannel, "position" | "topic" | "flags" | "permission_overwrites" | "rate_limit_per_user" | "nsfw" | "available_tags" | "default_reaction_emoji" | "last_message_id" | "default_sort_order" | "default_thread_rate_limit_per_user" | "default_auto_archive_duration" | "default_forum_layout">> { type: ThreadOnlyChannels; }
|
|
113
|
+
export interface RawForumChannel extends Omit<RawThreadOnlyChannel, "type"> { type: ChannelTypes.GUILD_FORUM; }
|
|
114
|
+
export interface RawMediaChannel extends Omit<RawThreadOnlyChannel, "type"> { type: ChannelTypes.GUILD_MEDIA; }
|
|
115
|
+
|
|
116
|
+
export interface PartialChannel extends Pick<RawChannel, "id" | "name" | "type"> {}
|
|
117
|
+
export interface RawInteractionResolvedChannel extends Omit<Required<Pick<RawChannel, "id" | "type">>, "name">, Pick<RawChannel, "thread_metadata" | "parent_id" | "permissions"> { name: string | null; }
|
|
118
|
+
|
|
119
|
+
export interface RawOverwrite {
|
|
120
|
+
allow: string;
|
|
121
|
+
deny: string;
|
|
122
|
+
id: string;
|
|
123
|
+
type: OverwriteTypes;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface Overwrite {
|
|
127
|
+
allow: string | bigint;
|
|
128
|
+
deny: string | bigint;
|
|
129
|
+
id: string;
|
|
130
|
+
type: OverwriteTypes;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface OverwriteOptions {
|
|
134
|
+
/** The permissions to allow. */
|
|
135
|
+
allow?: string | bigint | null;
|
|
136
|
+
/** The permissions to deny. */
|
|
137
|
+
deny?: string | bigint | null;
|
|
138
|
+
/** The ID of the user or role to apply the permissions to. */
|
|
139
|
+
id: string;
|
|
140
|
+
/** `0` for role, `1` for user. */
|
|
141
|
+
type: OverwriteTypes;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface RawThreadMetadata {
|
|
145
|
+
archive_timestamp: string;
|
|
146
|
+
archived: boolean;
|
|
147
|
+
auto_archive_duration: ThreadAutoArchiveDuration;
|
|
148
|
+
create_timestamp?: string | null;
|
|
149
|
+
invitable?: boolean;
|
|
150
|
+
locked: boolean;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface RawThreadMember {
|
|
154
|
+
flags: number;
|
|
155
|
+
id: string;
|
|
156
|
+
join_timestamp: string;
|
|
157
|
+
member?: RawMember;
|
|
158
|
+
user_id: string;
|
|
159
|
+
}
|
|
160
|
+
export type RawChannelThreadMember = Pick<RawThreadMember, "flags" | "join_timestamp">;
|
|
161
|
+
|
|
162
|
+
export interface ThreadMember extends UncachedThreadMember {
|
|
163
|
+
/** The flags for this thread member. Used for notifications. */
|
|
164
|
+
flags: number;
|
|
165
|
+
/** The time at which this member joined the thread. */
|
|
166
|
+
joinTimestamp: Date;
|
|
167
|
+
/** The guild member associated with this thread member, if fetched with `withMember` set to true. */
|
|
168
|
+
member?: Member;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface GetThreadMembersOptions {
|
|
172
|
+
/** Get members after this member id. */
|
|
173
|
+
after?: string;
|
|
174
|
+
/** The maximum number of thread members returned, defaults to 100. */
|
|
175
|
+
limit?: number;
|
|
176
|
+
/** If the results should include a `member` object. This also enables pagination. */
|
|
177
|
+
withMember?: boolean;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface UncachedThreadMember {
|
|
181
|
+
/** The ID of the thread this member is for. */
|
|
182
|
+
id: string;
|
|
183
|
+
/** The ID of the associated user. */
|
|
184
|
+
userID: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface GatewayThreadMember {
|
|
188
|
+
flags: number;
|
|
189
|
+
joinTimestamp: Date;
|
|
190
|
+
}
|
|
191
|
+
export interface EditGroupDMOptions {
|
|
192
|
+
/** [Group DM] The icon of the channel. */
|
|
193
|
+
icon?: string | Buffer;
|
|
194
|
+
/** The name of the channel. */
|
|
195
|
+
name?: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface EditGuildChannelOptions {
|
|
199
|
+
/** [Forum Thread] The ID of the forum available tags applied on the channel. A maximum of 5 can be applied. */
|
|
200
|
+
appliedTags?: Array<string>;
|
|
201
|
+
/** [Thread] If the thread is archived. */
|
|
202
|
+
archived?: boolean;
|
|
203
|
+
/** [Thread] The duration after which the thread will be archived. */
|
|
204
|
+
autoArchiveDuration?: ThreadAutoArchiveDuration;
|
|
205
|
+
/** [Forum] The {@link Types/Channels.ForumTag | tags} available in the channel. A maximum of 20 can be present. */
|
|
206
|
+
availableTags?: Array<Omit<ForumTag, "id"> & {
|
|
207
|
+
/** The ID of this tag. Omit if you want to create a new tag. */
|
|
208
|
+
id?: string;
|
|
209
|
+
}>;
|
|
210
|
+
/** [Stage, Voice] The bitrate of the channel. Minimum 8000. */
|
|
211
|
+
bitrate?: number | null;
|
|
212
|
+
/** [Announcement, Text] The default auto archive duration for threads made in this channel. */
|
|
213
|
+
defaultAutoArchiveDuration?: ThreadAutoArchiveDuration | null;
|
|
214
|
+
/** [Forum] The default forum layout used to display threads. */
|
|
215
|
+
defaultForumLayout?: ForumLayoutTypes;
|
|
216
|
+
/** [Forum] The default reaction emoji for threads. */
|
|
217
|
+
defaultReactionEmoji?: ForumEmoji | null;
|
|
218
|
+
/** [Forum] The default sort order mode used to sort forum threads. */
|
|
219
|
+
defaultSortOrder?: SortOrderTypes;
|
|
220
|
+
/** [Text, Forum] The default reaction emoji for threads. */
|
|
221
|
+
defaultThreadRateLimitPerUser?: number;
|
|
222
|
+
/** [Forum, Forum Thread] The {@link Constants.ChannelFlags | Channel Flags} to set on the channel. */
|
|
223
|
+
flags?: number;
|
|
224
|
+
/** [Private Thread] If non-moderators can add other non-moderators to the thread. */
|
|
225
|
+
invitable?: boolean;
|
|
226
|
+
/** [Thread] If the thread should be locked. */
|
|
227
|
+
locked?: boolean;
|
|
228
|
+
/** The name of the channel. */
|
|
229
|
+
name?: string;
|
|
230
|
+
/** [Announcement, Text, Voice] If the channel is age gated. */
|
|
231
|
+
nsfw?: string | null;
|
|
232
|
+
/** [Announcement, Forum, Text, Voice] The id of the parent category channel. */
|
|
233
|
+
parentID?: string | null;
|
|
234
|
+
/** Channel or category specific permissions. */
|
|
235
|
+
permissionOverwrites?: Array<OverwriteOptions> | null;
|
|
236
|
+
/** The position of the channel in the channel list. */
|
|
237
|
+
position?: number | null;
|
|
238
|
+
/** [Forum, Text, Thread] The seconds between sending messages for users. Between 0 and 21600. */
|
|
239
|
+
rateLimitPerUser?: number | null;
|
|
240
|
+
/** The reason to be displayed in the audit log. */
|
|
241
|
+
reason?: string;
|
|
242
|
+
/** [Stage, Voice] The voice region id of the channel, null for automatic. */
|
|
243
|
+
rtcRegion?: string | null;
|
|
244
|
+
/** [Announcement, Forum, Text, Voice] The topic of the channel. In forum channels, this is the `Guidelines` section. */
|
|
245
|
+
topic?: string | null;
|
|
246
|
+
/** [Announcement, Text] Provide the opposite type to convert the channel. */
|
|
247
|
+
type?: ChannelTypes.GUILD_TEXT | ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
248
|
+
/** [Voice] The maximum amount of users in the channel. `0` is unlimited, values range 1-99. */
|
|
249
|
+
userLimit?: number | null;
|
|
250
|
+
/** [Voice] The [video quality mode](https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes) of the channel. */
|
|
251
|
+
videoQualityMode?: VideoQualityModes | null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface EditChannelOptions extends EditGroupDMOptions, EditGuildChannelOptions {}
|
|
255
|
+
export interface EditAnyGuildChannelOptions extends Pick<EditGuildChannelOptions, "name" | "position" | "permissionOverwrites"> {}
|
|
256
|
+
export interface EditTextChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "topic" | "nsfw" | "rateLimitPerUser" | "parentID" | "defaultAutoArchiveDuration"> { type?: ChannelTypes.GUILD_ANNOUNCEMENT; }
|
|
257
|
+
export interface EditAnnouncementChannelOptions extends Omit<EditTextChannelOptions, "rateLimitPerUser" | "type"> { type?: ChannelTypes.GUILD_TEXT; }
|
|
258
|
+
export interface EditVoiceChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "nsfw" | "bitrate" | "userLimit" | "parentID" | "rtcRegion" | "videoQualityMode"> {}
|
|
259
|
+
export interface EditStageChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "bitrate" | "rtcRegion"> {}
|
|
260
|
+
export interface EditThreadChannelOptions extends EditPublicThreadChannelOptions, EditPrivateThreadChannelOptions {}
|
|
261
|
+
export interface EditPublicThreadChannelOptions extends Pick<EditGuildChannelOptions, "name" | "archived" | "autoArchiveDuration" | "locked" | "rateLimitPerUser" | "flags" | "appliedTags"> {}
|
|
262
|
+
export interface EditPrivateThreadChannelOptions extends EditPublicThreadChannelOptions, Pick<EditGuildChannelOptions, "invitable"> {}
|
|
263
|
+
export interface EditForumChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "availableTags" | "defaultReactionEmoji" | "defaultSortOrder" |"defaultThreadRateLimitPerUser" | "flags" | "nsfw" | "rateLimitPerUser" | "topic" | "defaultForumLayout"> {}
|
|
264
|
+
export interface EditMediaChannelOptions extends EditAnyGuildChannelOptions, Pick<EditGuildChannelOptions, "availableTags" | "defaultReactionEmoji" | "defaultSortOrder" |"defaultThreadRateLimitPerUser" | "flags" | "nsfw" | "rateLimitPerUser" | "topic"> {}
|
|
265
|
+
|
|
266
|
+
/* eslint-disable @typescript-eslint/member-ordering */
|
|
267
|
+
export interface EditChannelOptionsMap {
|
|
268
|
+
[ChannelTypes.GUILD_TEXT]: EditTextChannelOptions;
|
|
269
|
+
[ChannelTypes.DM]: never;
|
|
270
|
+
[ChannelTypes.GUILD_VOICE]: EditVoiceChannelOptions;
|
|
271
|
+
[ChannelTypes.GROUP_DM]: EditGroupDMOptions;
|
|
272
|
+
[ChannelTypes.GUILD_CATEGORY]: EditAnyGuildChannelOptions;
|
|
273
|
+
[ChannelTypes.GUILD_ANNOUNCEMENT]: EditAnnouncementChannelOptions;
|
|
274
|
+
[ChannelTypes.ANNOUNCEMENT_THREAD]: EditPublicThreadChannelOptions;
|
|
275
|
+
[ChannelTypes.PUBLIC_THREAD]: EditPublicThreadChannelOptions;
|
|
276
|
+
[ChannelTypes.PRIVATE_THREAD]: EditPrivateThreadChannelOptions;
|
|
277
|
+
[ChannelTypes.GUILD_STAGE_VOICE]: EditStageChannelOptions;
|
|
278
|
+
[ChannelTypes.GUILD_DIRECTORY]: never;
|
|
279
|
+
[ChannelTypes.GUILD_FORUM]: EditForumChannelOptions;
|
|
280
|
+
[ChannelTypes.GUILD_MEDIA]: EditMediaChannelOptions;
|
|
281
|
+
}
|
|
282
|
+
/* eslint-enable @typescript-eslint/member-ordering */
|
|
283
|
+
|
|
284
|
+
export interface AddGroupRecipientOptions {
|
|
285
|
+
/** The access token of the user to add. */
|
|
286
|
+
accessToken: string;
|
|
287
|
+
/** The nickname of the user to add. */
|
|
288
|
+
nick?: string;
|
|
289
|
+
/** The id of the user to add. */
|
|
290
|
+
userID: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// make sure to add to ExecuteWebhookOptions & InteractionContent
|
|
294
|
+
export interface CreateMessageOptions {
|
|
295
|
+
/** An object that specifies the allowed mentions in this message. */
|
|
296
|
+
allowedMentions?: AllowedMentions;
|
|
297
|
+
/** An array of [partial attachments](https://discord.com/developers/docs/resources/channel#attachment-object) related to the sent files. */
|
|
298
|
+
attachments?: Array<MessageAttachment>;
|
|
299
|
+
/** An array of [components](https://discord.com/developers/docs/interactions/message-components) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawMessageComponents | Util#rawMessageComponents}. */
|
|
300
|
+
components?: Array<MessageActionRow>;
|
|
301
|
+
/** The content of the message. */
|
|
302
|
+
content?: string;
|
|
303
|
+
/** An array of [embeds](https://discord.com/developers/docs/resources/channel#embed-object) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawEmbeds | Util#rawEmbeds}. */
|
|
304
|
+
embeds?: Array<EmbedOptions>;
|
|
305
|
+
/** If Discord should enforce the unique nonce. This prevents duplicate messages being sent within a few minutes. */
|
|
306
|
+
enforceNonce?: boolean;
|
|
307
|
+
/** The files to send. */
|
|
308
|
+
files?: Array<File>;
|
|
309
|
+
/** The [flags](https://discord.com/developers/docs/resources/channel#message-object-message-flags) to send with the message. */
|
|
310
|
+
flags?: number;
|
|
311
|
+
/** Reply to a message. */
|
|
312
|
+
messageReference?: MessageReference;
|
|
313
|
+
/** A unique number or string used to dedupe this message. `enforceNonce` must be set to true for Discord to dedupe message sends. */
|
|
314
|
+
nonce?: string | number;
|
|
315
|
+
/**
|
|
316
|
+
* A poll to send. Messages with a poll cannot be edited.
|
|
317
|
+
* @note As of [4/18/24](https://github.com/discord/discord-api-docs/pull/6746#issuecomment-2064810908), `attachments` cannot be sent with polls.
|
|
318
|
+
*/
|
|
319
|
+
poll?: MessagePollOptions;
|
|
320
|
+
/** The IDs of up to 3 stickers from the current guild to send. */
|
|
321
|
+
stickerIDs?: Array<string>;
|
|
322
|
+
/** If the message should be spoken aloud. */
|
|
323
|
+
tts?: boolean;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export interface EmbedOptionsBase {
|
|
327
|
+
color?: number;
|
|
328
|
+
description?: string;
|
|
329
|
+
timestamp?: string;
|
|
330
|
+
title?: string;
|
|
331
|
+
url?: string;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface RawEmbedOptions extends EmbedOptionsBase {
|
|
335
|
+
author?: RawEmbedAuthorOptions;
|
|
336
|
+
fields?: Array<EmbedField>;
|
|
337
|
+
footer?: RawEmbedFooterOptions;
|
|
338
|
+
image?: EmbedImageOptions;
|
|
339
|
+
thumbnail?: EmbedImageOptions;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export interface EmbedOptions extends EmbedOptionsBase {
|
|
343
|
+
author?: EmbedAuthorOptions;
|
|
344
|
+
fields?: Array<EmbedField>;
|
|
345
|
+
footer?: EmbedFooterOptions;
|
|
346
|
+
image?: EmbedImageOptions;
|
|
347
|
+
thumbnail?: EmbedImageOptions;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface EmbedBase extends EmbedOptionsBase {
|
|
351
|
+
type?: EmbedType;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface RawEmbed extends EmbedBase {
|
|
355
|
+
author?: RawEmbedAuthor;
|
|
356
|
+
fields?: Array<EmbedField>;
|
|
357
|
+
footer?: RawEmbedFooter;
|
|
358
|
+
image?: RawEmbedImage;
|
|
359
|
+
provider?: EmbedProvider;
|
|
360
|
+
thumbnail?: RawEmbedImage;
|
|
361
|
+
video?: RawEmbedVideo;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export interface Embed extends EmbedBase {
|
|
365
|
+
author?: EmbedAuthor;
|
|
366
|
+
fields?: Array<EmbedField>;
|
|
367
|
+
footer?: EmbedFooter;
|
|
368
|
+
image?: EmbedImage;
|
|
369
|
+
provider?: EmbedProvider;
|
|
370
|
+
thumbnail?: EmbedImage;
|
|
371
|
+
video?: EmbedVideo;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export type EmbedType = "rich" | "image" | "video" | "gifv" | "article" | "link";
|
|
375
|
+
|
|
376
|
+
export interface EmbedAuthorBase {
|
|
377
|
+
name: string;
|
|
378
|
+
url?: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export interface RawEmbedAuthor extends EmbedAuthorBase {
|
|
382
|
+
icon_url?: string;
|
|
383
|
+
proxy_icon_url?: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface EmbedAuthorOptions extends EmbedAuthorBase {
|
|
387
|
+
iconURL?: string;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export interface RawEmbedAuthorOptions extends EmbedAuthorBase {
|
|
391
|
+
icon_url?: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export interface EmbedAuthor extends EmbedAuthorOptions {
|
|
395
|
+
iconURL?: string;
|
|
396
|
+
proxyIconURL?: string;
|
|
397
|
+
}
|
|
398
|
+
export interface EmbedFooterBase {
|
|
399
|
+
text: string;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface EmbedFooterOptions extends EmbedFooterBase {
|
|
403
|
+
iconURL?: string;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export interface RawEmbedFooterOptions extends EmbedFooterBase {
|
|
407
|
+
icon_url?: string;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export interface RawEmbedFooter extends EmbedFooterBase {
|
|
411
|
+
icon_url?: string;
|
|
412
|
+
proxy_icon_url?: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface EmbedFooter extends EmbedFooterOptions {
|
|
416
|
+
iconURL?: string;
|
|
417
|
+
proxyIconURL?: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export interface EmbedImageBase {
|
|
421
|
+
height?: number;
|
|
422
|
+
width?: number;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export interface RawEmbedImage extends EmbedImageBase, EmbedImageOptions {
|
|
426
|
+
proxy_url?: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface EmbedImageOptions {
|
|
430
|
+
url: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface EmbedImage extends EmbedImageBase, EmbedImageOptions {
|
|
434
|
+
proxyURL?: string;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export interface EmbedField {
|
|
438
|
+
inline?: boolean;
|
|
439
|
+
name: string;
|
|
440
|
+
value: string;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export interface EmbedVideoBase {
|
|
444
|
+
height?: number;
|
|
445
|
+
url?: string;
|
|
446
|
+
width?: number;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export interface RawEmbedVideo extends EmbedVideoBase {
|
|
450
|
+
proxy_url?: string;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface EmbedVideo extends EmbedVideoBase {
|
|
454
|
+
proxyURL?: string;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export interface EmbedProvider {
|
|
458
|
+
name?: string;
|
|
459
|
+
url?: string;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface AllowedMentions {
|
|
463
|
+
/** If `@everyone`/`@here` mentions should be allowed. */
|
|
464
|
+
everyone?: boolean;
|
|
465
|
+
/** If the replied user (`messageReference`) should be mentioned. */
|
|
466
|
+
repliedUser?: boolean;
|
|
467
|
+
/** An array of role ids that are allowed to be mentioned, or a boolean value to allow all or none. */
|
|
468
|
+
roles?: boolean | Array<string>;
|
|
469
|
+
/** An array of user ids that are allowed to be mentioned, or a boolean value to allow all or none. */
|
|
470
|
+
users?: boolean | Array<string>;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export interface MessageReference {
|
|
474
|
+
/** The ID of the channel the replied message is in. */
|
|
475
|
+
channelID?: string;
|
|
476
|
+
/** If creating the message should fail if the message to reply to does not exist. */
|
|
477
|
+
failIfNotExists?: boolean;
|
|
478
|
+
/** The ID of the guild the replied message is in. */
|
|
479
|
+
guildID?: string;
|
|
480
|
+
/** The ID of the message to reply to. */
|
|
481
|
+
messageID?: string;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export type RawComponent = RawMessageComponent | RawModalComponent;
|
|
485
|
+
export type RawMessageComponent = RawButtonComponent | RawSelectMenuComponent;
|
|
486
|
+
export type RawModalComponent = RawTextInput;
|
|
487
|
+
export type RawButtonComponent = RawTextButton | URLButton;
|
|
488
|
+
export type RawSelectMenuComponent = RawStringSelectMenu | RawUserSelectMenu | RawRoleSelectMenu | RawMentionableSelectMenu | RawChannelSelectMenu;
|
|
489
|
+
export type ToComponentFromRaw<T extends RawComponent> =
|
|
490
|
+
T extends RawTextButton ? TextButton :
|
|
491
|
+
T extends URLButton ? URLButton :
|
|
492
|
+
T extends RawStringSelectMenu ? StringSelectMenu :
|
|
493
|
+
T extends RawUserSelectMenu ? UserSelectMenu :
|
|
494
|
+
T extends RawRoleSelectMenu ? RoleSelectMenu :
|
|
495
|
+
T extends RawMentionableSelectMenu ? MentionableSelectMenu :
|
|
496
|
+
T extends RawChannelSelectMenu ? ChannelSelectMenu :
|
|
497
|
+
T extends RawTextInput ? TextInput :
|
|
498
|
+
never;
|
|
499
|
+
export type ToRawFromComponent<T extends Component> =
|
|
500
|
+
T extends TextButton ? RawTextButton :
|
|
501
|
+
T extends URLButton ? URLButton :
|
|
502
|
+
T extends StringSelectMenu ? RawStringSelectMenu :
|
|
503
|
+
T extends UserSelectMenu ? RawUserSelectMenu :
|
|
504
|
+
T extends RoleSelectMenu ? RawRoleSelectMenu :
|
|
505
|
+
T extends MentionableSelectMenu ? RawMentionableSelectMenu :
|
|
506
|
+
T extends ChannelSelectMenu ? RawChannelSelectMenu :
|
|
507
|
+
T extends TextInput ? RawTextInput :
|
|
508
|
+
never;
|
|
509
|
+
export interface RawActionRowBase<T extends RawComponent> {
|
|
510
|
+
components: Array<T>;
|
|
511
|
+
type: ComponentTypes.ACTION_ROW;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
export interface RawMessageActionRow extends RawActionRowBase<RawMessageComponent> {}
|
|
515
|
+
export interface RawModalActionRow extends RawActionRowBase<RawModalComponent> {}
|
|
516
|
+
export type ActionRowToRaw<T extends MessageActionRow | ModalActionRow> =
|
|
517
|
+
T extends MessageActionRow ? RawMessageActionRow :
|
|
518
|
+
T extends ModalActionRow ? RawModalActionRow : never;
|
|
519
|
+
|
|
520
|
+
export type Component = MessageComponent | ModalComponent;
|
|
521
|
+
export type MessageComponent = ButtonComponent | SelectMenuComponent;
|
|
522
|
+
export type ModalComponent = TextInput;
|
|
523
|
+
export type ButtonComponent = TextButton | URLButton;
|
|
524
|
+
export type SelectMenuComponent = StringSelectMenu | UserSelectMenu | RoleSelectMenu | MentionableSelectMenu | ChannelSelectMenu;
|
|
525
|
+
|
|
526
|
+
export interface ActionRowBase<T extends Component> {
|
|
527
|
+
components: Array<T>;
|
|
528
|
+
type: ComponentTypes.ACTION_ROW;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export interface MessageActionRow extends ActionRowBase<MessageComponent> {}
|
|
532
|
+
export interface ModalActionRow extends ActionRowBase<ModalComponent> {}
|
|
533
|
+
|
|
534
|
+
export interface ButtonBase {
|
|
535
|
+
disabled?: boolean;
|
|
536
|
+
emoji?: NullablePartialEmoji;
|
|
537
|
+
label?: string;
|
|
538
|
+
style: ButtonStyles;
|
|
539
|
+
type: ComponentTypes.BUTTON;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
export interface RawTextButton extends ButtonBase {
|
|
543
|
+
custom_id: string;
|
|
544
|
+
style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export interface TextButton extends ButtonBase {
|
|
548
|
+
customID: string;
|
|
549
|
+
style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export interface URLButton extends ButtonBase {
|
|
553
|
+
style: ButtonStyles.LINK;
|
|
554
|
+
url: string;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export interface RawSelectMenuBase<T extends SelectMenuTypes> {
|
|
558
|
+
custom_id: string;
|
|
559
|
+
disabled?: boolean;
|
|
560
|
+
max_values?: number;
|
|
561
|
+
min_values?: number;
|
|
562
|
+
placeholder?: string;
|
|
563
|
+
type: T;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export interface RawStringSelectMenuOptions {
|
|
567
|
+
options: Array<SelectOption>;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export interface RawChannelSelectMenuOptions {
|
|
571
|
+
channel_types: Array<ChannelTypes>;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export interface RawStringSelectMenu extends RawSelectMenuBase<ComponentTypes.STRING_SELECT>, RawStringSelectMenuOptions {}
|
|
575
|
+
export interface RawUserSelectMenu extends RawSelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValuesRaw {}
|
|
576
|
+
export interface RawRoleSelectMenu extends RawSelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValuesRaw {}
|
|
577
|
+
export interface RawMentionableSelectMenu extends RawSelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValuesRaw {}
|
|
578
|
+
export interface RawChannelSelectMenu extends RawSelectMenuBase<ComponentTypes.CHANNEL_SELECT>, RawChannelSelectMenuOptions, DefaultValuesRaw {}
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
export interface SelectMenuBase<T extends SelectMenuTypes> {
|
|
582
|
+
customID: string;
|
|
583
|
+
disabled?: boolean;
|
|
584
|
+
maxValues?: number;
|
|
585
|
+
minValues?: number;
|
|
586
|
+
placeholder?: string;
|
|
587
|
+
type: T;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
interface DefaultValuesRaw {
|
|
591
|
+
default_values?: Array<SelectMenuDefaultValue>;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
interface DefaultValues {
|
|
595
|
+
defaultValues?: Array<SelectMenuDefaultValue>;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export interface StringSelectMenuOptions {
|
|
599
|
+
options: Array<SelectOption>;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export interface ChannelSelectMenuOptions {
|
|
603
|
+
channelTypes: Array<ChannelTypes>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export interface StringSelectMenu extends SelectMenuBase<ComponentTypes.STRING_SELECT>, StringSelectMenuOptions {}
|
|
607
|
+
export interface UserSelectMenu extends SelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValues {}
|
|
608
|
+
export interface RoleSelectMenu extends SelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValues {}
|
|
609
|
+
export interface MentionableSelectMenu extends SelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValues {}
|
|
610
|
+
export interface ChannelSelectMenu extends SelectMenuBase<ComponentTypes.CHANNEL_SELECT>, ChannelSelectMenuOptions, DefaultValues {}
|
|
611
|
+
|
|
612
|
+
export interface SelectOption {
|
|
613
|
+
default?: boolean;
|
|
614
|
+
description?: string;
|
|
615
|
+
emoji?: NullablePartialEmoji;
|
|
616
|
+
label: string;
|
|
617
|
+
value: string;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
export interface RawTextInput {
|
|
621
|
+
custom_id: string;
|
|
622
|
+
label: string;
|
|
623
|
+
max_length?: number;
|
|
624
|
+
min_length?: number;
|
|
625
|
+
placeholder?: string;
|
|
626
|
+
required?: boolean;
|
|
627
|
+
style: TextInputStyles;
|
|
628
|
+
type: ComponentTypes.TEXT_INPUT;
|
|
629
|
+
value?: string;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export interface TextInput {
|
|
633
|
+
customID: string;
|
|
634
|
+
label: string;
|
|
635
|
+
maxLength?: number;
|
|
636
|
+
minLength?: number;
|
|
637
|
+
placeholder?: string;
|
|
638
|
+
required?: boolean;
|
|
639
|
+
style: TextInputStyles;
|
|
640
|
+
type: ComponentTypes.TEXT_INPUT;
|
|
641
|
+
value?: string;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export interface RawAttachment {
|
|
645
|
+
content_type?: string;
|
|
646
|
+
description?: string;
|
|
647
|
+
duration_secs?: number;
|
|
648
|
+
ephemeral?: boolean;
|
|
649
|
+
filename: string;
|
|
650
|
+
flags?: number;
|
|
651
|
+
height?: number;
|
|
652
|
+
id: string;
|
|
653
|
+
proxy_url: string;
|
|
654
|
+
size: number;
|
|
655
|
+
url: string;
|
|
656
|
+
waveform?: string | null;
|
|
657
|
+
width?: number;
|
|
658
|
+
}
|
|
659
|
+
// @TODO verify what can be sent with `attachments` in message creation/deletion, this is an assumption
|
|
660
|
+
export interface MessageAttachment extends Partial<Pick<RawAttachment, "description" | "filename">> {
|
|
661
|
+
/** The id of the attachment to edit, or the index of `files` to reference. */
|
|
662
|
+
id?: string | number;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
export interface RawAllowedMentions {
|
|
666
|
+
parse: Array<"everyone" | "roles" | "users">;
|
|
667
|
+
replied_user?: boolean;
|
|
668
|
+
roles?: Array<string>;
|
|
669
|
+
users?: Array<string>;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export interface RawMessage {
|
|
673
|
+
activity?: MessageActivity;
|
|
674
|
+
application?: RawApplication; // @TODO specific properties sent
|
|
675
|
+
application_id?: string;
|
|
676
|
+
attachments: Array<RawAttachment>;
|
|
677
|
+
author: RawUser; // this can be an invalid user if `webhook_id` is set
|
|
678
|
+
channel_id: string;
|
|
679
|
+
components?: Array<RawMessageActionRow>;
|
|
680
|
+
content: string;
|
|
681
|
+
edited_timestamp: string | null;
|
|
682
|
+
embeds: Array<RawEmbed>;
|
|
683
|
+
flags?: number;
|
|
684
|
+
guild_id?: string;
|
|
685
|
+
id: string;
|
|
686
|
+
/** @deprecated */
|
|
687
|
+
interaction?: RawMessageInteraction;
|
|
688
|
+
interaction_metadata?: RawMessageInteractionMetadata;
|
|
689
|
+
member?: RawMember;
|
|
690
|
+
mention_channels?: Array<ChannelMention>;
|
|
691
|
+
mention_everyone: boolean;
|
|
692
|
+
mention_roles: Array<string>;
|
|
693
|
+
mentions: Array<RawUserWithMember>;
|
|
694
|
+
message_reference?: RawMessageReference;
|
|
695
|
+
nonce?: number | string;
|
|
696
|
+
pinned: boolean;
|
|
697
|
+
poll?: RawPoll;
|
|
698
|
+
position?: number;
|
|
699
|
+
reactions?: Array<RawMessageReaction>;
|
|
700
|
+
referenced_message?: RawMessage | null;
|
|
701
|
+
role_subscription_data?: RawRoleSubscriptionData;
|
|
702
|
+
// stickers exists, but is deprecated
|
|
703
|
+
sticker_items?: Array<StickerItem>;
|
|
704
|
+
thread?: RawAnnouncementThreadChannel | RawPublicThreadChannel | RawPrivateThreadChannel;
|
|
705
|
+
timestamp: string;
|
|
706
|
+
tts: boolean;
|
|
707
|
+
type: MessageTypes;
|
|
708
|
+
webhook_id?: string;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export interface ChannelMention {
|
|
712
|
+
guild_id: string;
|
|
713
|
+
id: string;
|
|
714
|
+
name: string;
|
|
715
|
+
type: ChannelTypes;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export interface MessageReactionCountDetails {
|
|
719
|
+
burst: number;
|
|
720
|
+
normal: number;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
export interface RawMessageReaction {
|
|
724
|
+
burst_colors: Array<string>;
|
|
725
|
+
count: number;
|
|
726
|
+
count_details: MessageReactionCountDetails;
|
|
727
|
+
emoji: PartialEmoji;
|
|
728
|
+
me: boolean;
|
|
729
|
+
me_burst: boolean;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export interface MessageReaction {
|
|
733
|
+
burstColors: Array<string>;
|
|
734
|
+
count: number;
|
|
735
|
+
countDetails: MessageReactionCountDetails;
|
|
736
|
+
emoji: PartialEmoji;
|
|
737
|
+
me: boolean;
|
|
738
|
+
meBurst: boolean;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export interface MessageActivity {
|
|
742
|
+
party_id?: string;
|
|
743
|
+
type: MessageActivityTypes;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
export interface RawMessageReference {
|
|
748
|
+
channel_id: string;
|
|
749
|
+
fail_if_not_exists: boolean;
|
|
750
|
+
guild_id: string;
|
|
751
|
+
message_id: string;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export interface RawMessageInteraction {
|
|
755
|
+
id: string;
|
|
756
|
+
member?: RawMember;
|
|
757
|
+
name: string;
|
|
758
|
+
type: InteractionTypes;
|
|
759
|
+
user: RawUser;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/** @deprecated */
|
|
763
|
+
export interface MessageInteraction {
|
|
764
|
+
id: string;
|
|
765
|
+
member?: Member;
|
|
766
|
+
name: string;
|
|
767
|
+
type: InteractionTypes;
|
|
768
|
+
user: User;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
export interface RawMessageInteractionMetadata {
|
|
772
|
+
authorizing_integration_owners: AuthorizingIntegrationOwners;
|
|
773
|
+
id: string;
|
|
774
|
+
interacted_message_id?: string;
|
|
775
|
+
name?: string;
|
|
776
|
+
original_response_message_id?: string;
|
|
777
|
+
triggering_interaction_metadata?: Omit<RawMessageInteractionMetadata, "triggering_interaction_metadata">;
|
|
778
|
+
type: InteractionTypes;
|
|
779
|
+
user: RawUser;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
export interface MessageInteractionMetadata {
|
|
783
|
+
/** Details about the authorizing user or server for the installation(s) relevant to the interaction. See [Discord's docs](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object) for more information. */
|
|
784
|
+
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
|
785
|
+
id: string;
|
|
786
|
+
/** The ID of the message that contained interactive component, present only on messages created from component interactions */
|
|
787
|
+
interactedMessageID?: string;
|
|
788
|
+
/** Name of the command, including subcommands and subcommand groups, present only on application command interactions. */
|
|
789
|
+
name?: string;
|
|
790
|
+
/** The ID of the original response message, present only on follow-up messages. */
|
|
791
|
+
originalResponseMessageID?: string;
|
|
792
|
+
/** Metadata for the interaction that was used to open the modal, present only on modal submit interactions. */
|
|
793
|
+
triggeringInteractionMetadata?: Omit<MessageInteractionMetadata, "triggeringInteractionMetadata" | "name">;
|
|
794
|
+
type: InteractionTypes;
|
|
795
|
+
user: User;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
export interface StickerItem {
|
|
800
|
+
format_type: StickerFormatTypes;
|
|
801
|
+
id: string;
|
|
802
|
+
name: string;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export type NotImplementedChannels = typeof NotImplementedChannelTypes[number];
|
|
806
|
+
export type ImplementedChannels = typeof ImplementedChannelTypes[number];
|
|
807
|
+
export type GuildChannels = typeof GuildChannelTypes[number];
|
|
808
|
+
export type ThreadChannels = typeof ThreadChannelTypes[number];
|
|
809
|
+
export type GuildChannelsWithoutThreads = typeof GuildChannelsWithoutThreadsTypes[number];
|
|
810
|
+
export type PrivateChannels = typeof PrivateChannelTypes[number];
|
|
811
|
+
export type EditableChannels = typeof EditableChannelTypes[number];
|
|
812
|
+
export type TextableChannels = typeof TextableChannelTypes[number];
|
|
813
|
+
export type TextableGuildChannels = typeof TextableGuildChannelTypes[number];
|
|
814
|
+
export type TextableChannelsWithoutThreads = typeof TextableChannelsWithoutThreadsTypes[number];
|
|
815
|
+
export type TextableGuildChannelsWithoutThreads = typeof TextableGuildChannelsWithoutThreadsTypes[number];
|
|
816
|
+
export type VoiceChannels = typeof VoiceChannelTypes[number];
|
|
817
|
+
export type InviteChannels = typeof InviteChannelTypes[number];
|
|
818
|
+
export type InteractionChannels = typeof InteractionChannelTypes[number];
|
|
819
|
+
export type ThreadOnlyChannels = typeof ThreadOnlyChannelTypes[number];
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
export type AnyChannel = ChannelTypeMap[ChannelTypes];
|
|
823
|
+
export type AnyNotImplementedChannel = ChannelTypeMap[NotImplementedChannels];
|
|
824
|
+
export type AnyImplementedChannel = ChannelTypeMap[ImplementedChannels];
|
|
825
|
+
export type AnyGuildChannel = ChannelTypeMap[GuildChannels];
|
|
826
|
+
export type AnyThreadChannel = ChannelTypeMap[ThreadChannels];
|
|
827
|
+
export type AnyGuildChannelWithoutThreads = ChannelTypeMap[GuildChannelsWithoutThreads];
|
|
828
|
+
export type AnyPrivateChannel = ChannelTypeMap[PrivateChannels];
|
|
829
|
+
export type AnyEditableChannel = ChannelTypeMap[EditableChannels];
|
|
830
|
+
export type AnyTextableChannel = ChannelTypeMap[TextableChannels];
|
|
831
|
+
export type AnyTextableGuildChannel = ChannelTypeMap[TextableGuildChannels];
|
|
832
|
+
export type AnyTextableChannelWithoutThreads = ChannelTypeMap[TextableChannelsWithoutThreads];
|
|
833
|
+
export type AnyTextableGuildChannelWithoutThreads = ChannelTypeMap[TextableGuildChannelsWithoutThreads];
|
|
834
|
+
export type AnyVoiceChannel = ChannelTypeMap[VoiceChannels];
|
|
835
|
+
export type AnyInviteChannel = ChannelTypeMap[InviteChannels];
|
|
836
|
+
export type AnyInteractionChannel = ChannelTypeMap[InteractionChannels];
|
|
837
|
+
export type AnyThreadOnlyChannel = ChannelTypeMap[ThreadOnlyChannels];
|
|
838
|
+
|
|
839
|
+
export interface PartialInviteChannel {
|
|
840
|
+
icon?: string | null;
|
|
841
|
+
id: string;
|
|
842
|
+
name: string | null;
|
|
843
|
+
type: InviteChannels;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export type PossiblyUncachedInvite = Invite | UncachedInvite;
|
|
847
|
+
export interface UncachedInvite {
|
|
848
|
+
channel?: AnyInviteChannel | Uncached;
|
|
849
|
+
code: string;
|
|
850
|
+
guild?: Guild | Uncached;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
export interface GetChannelMessagesOptions<T extends AnyTextableChannel | Uncached = AnyTextableChannel | Uncached> {
|
|
854
|
+
/** Get messages after this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
855
|
+
after?: string;
|
|
856
|
+
/** Get messages around this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
857
|
+
around?: string;
|
|
858
|
+
/** Get messages before this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
859
|
+
before?: string;
|
|
860
|
+
/** The maximum amount of messages to get. Defaults to 100. Use Infinity if you wish to get as many messages as possible. */
|
|
861
|
+
limit?: number;
|
|
862
|
+
/**
|
|
863
|
+
* A function used to reject certain messages. If `"break"` is returned, further iteration of messages will stop and the previously allowed messages will be returned.
|
|
864
|
+
* @param message The message to filter.
|
|
865
|
+
*/
|
|
866
|
+
filter?(message: Message<T>): boolean | "break" | PromiseLike<boolean | "break">;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export interface GetChannelMessagesIteratorOptions<T extends AnyTextableChannel | Uncached = AnyTextableChannel | Uncached> {
|
|
870
|
+
/** Get messages after this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
871
|
+
after?: string;
|
|
872
|
+
/** Get messages before this message ID. IDs don't need to be valid, an ID can be generated for any timestamp via {@link Base.generateID | Base#generateID}. */
|
|
873
|
+
before?: string;
|
|
874
|
+
/** The maximum amount of messages to get. Defaults to 100. Use Infinity if you wish to get as many messages as possible. */
|
|
875
|
+
limit?: number;
|
|
876
|
+
/**
|
|
877
|
+
* A function used to reject certain messages. If `"break"` is returned, the iterator will immediately exit and yield the previously allowed messages.
|
|
878
|
+
* @param message The message to filter.
|
|
879
|
+
*/
|
|
880
|
+
filter?(message: Message<T>): boolean | "break" | PromiseLike<boolean | "break">;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export interface MessagesIterator<T extends AnyTextableChannel | Uncached = AnyTextableChannel | Uncached> extends AsyncIterable<Array<Message<T>>> {
|
|
884
|
+
/** The most recent "last" message seen by the iterator, used for future requests. */
|
|
885
|
+
lastMessage?: string;
|
|
886
|
+
/** The current limit of remaining messages to get. */
|
|
887
|
+
limit: number;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export interface GetReactionsOptions {
|
|
891
|
+
/** The ID of the user to get reactions after. */
|
|
892
|
+
after?: string;
|
|
893
|
+
/** The maximum amount of reactions to get. Defaults to 100. Use Infinity if you wish to get as many reactions as possible. */
|
|
894
|
+
limit?: number;
|
|
895
|
+
/** The type of reactions to get. Defaults to normal. */
|
|
896
|
+
type?: ReactionType;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
export interface EditMessageOptions extends Nullable<Pick<CreateMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "attachments" | "files" | "flags">> {}
|
|
900
|
+
|
|
901
|
+
export interface EditPermissionOptions {
|
|
902
|
+
/** The permissions to allow. */
|
|
903
|
+
allow?: bigint | string;
|
|
904
|
+
/** The permissions to deny. */
|
|
905
|
+
deny?: bigint | string;
|
|
906
|
+
/** The reason for editing the permission. */
|
|
907
|
+
reason?: string;
|
|
908
|
+
/** The type of the permission overwrite. */
|
|
909
|
+
type: OverwriteTypes;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
export interface RawInvite {
|
|
913
|
+
approximate_member_count?: number;
|
|
914
|
+
approximate_presence_count?: number;
|
|
915
|
+
// this is partial because the gateway only gets an id
|
|
916
|
+
channel?: PartialChannel;
|
|
917
|
+
// gateway
|
|
918
|
+
channel_id?: string;
|
|
919
|
+
code: string;
|
|
920
|
+
expires_at?: string;
|
|
921
|
+
flags?: number;
|
|
922
|
+
guild?: RawInviteGuild;
|
|
923
|
+
guild_scheduled_event?: RawScheduledEvent;
|
|
924
|
+
inviter?: RawUser;
|
|
925
|
+
/** @deprecated */
|
|
926
|
+
stage_instance?: RawInviteStageInstance;
|
|
927
|
+
target_application?: RawPartialApplication;
|
|
928
|
+
target_type?: InviteTargetTypes;
|
|
929
|
+
target_user?: RawUser;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export interface RawInviteWithMetadata extends RawInvite {
|
|
933
|
+
created_at: string;
|
|
934
|
+
max_age: number;
|
|
935
|
+
max_uses: number;
|
|
936
|
+
temporary: boolean;
|
|
937
|
+
uses: number;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
export interface RawInviteStageInstance {
|
|
942
|
+
members: Array<RawMember>;
|
|
943
|
+
participant_count: number;
|
|
944
|
+
speaker_count: number;
|
|
945
|
+
topic: string;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
export interface InviteStageInstance {
|
|
950
|
+
members: Array<Member>;
|
|
951
|
+
participantCount: number;
|
|
952
|
+
speakerCount: number;
|
|
953
|
+
topic: string;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export interface CreateInviteOptions {
|
|
957
|
+
/** How long the invite should last. */
|
|
958
|
+
maxAge?: number;
|
|
959
|
+
/** How many times the invite can be used. */
|
|
960
|
+
maxUses?: number;
|
|
961
|
+
/** The reason for creating the invite. */
|
|
962
|
+
reason?: string;
|
|
963
|
+
/** The id of the embedded application to open for this invite. */
|
|
964
|
+
targetApplicationID?: string;
|
|
965
|
+
/** The [type of target](https://discord.com/developers/docs/resources/channel#invite-target-types) for the invite. */
|
|
966
|
+
targetType?: InviteTargetTypes;
|
|
967
|
+
/** The ID of the user whose stream to display for this invite. */
|
|
968
|
+
targetUserID?: string;
|
|
969
|
+
/** If the invite should be temporary. */
|
|
970
|
+
temporary?: boolean;
|
|
971
|
+
/** If the invite should be unique. */
|
|
972
|
+
unique?: boolean;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export interface RawFollowedChannel {
|
|
976
|
+
channel_id: string;
|
|
977
|
+
webhook_id: string;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
export interface FollowedChannel {
|
|
981
|
+
channelID: string;
|
|
982
|
+
webhookID: string;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
export interface StartThreadFromMessageOptions {
|
|
986
|
+
/** The duration of no activity after which this thread will be automatically archived. */
|
|
987
|
+
autoArchiveDuration?: ThreadAutoArchiveDuration;
|
|
988
|
+
/** The name of the thread. */
|
|
989
|
+
name: string;
|
|
990
|
+
/** The amount of seconds a user has to wait before sending another message. */
|
|
991
|
+
rateLimitPerUser?: number | null;
|
|
992
|
+
/** The reason for creating the thread. */
|
|
993
|
+
reason?: string;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
export interface StartThreadWithoutMessageOptions extends StartThreadFromMessageOptions {
|
|
997
|
+
/** [Private Thread Only] If non-moderators can add other non-moderators to the thread. */
|
|
998
|
+
invitable?: boolean;
|
|
999
|
+
/** The type of thread to create. */
|
|
1000
|
+
type: ThreadChannels;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
export interface StartThreadInThreadOnlyChannelOptions extends StartThreadFromMessageOptions {
|
|
1004
|
+
/** [Forum Channel Only] The IDs of up to 5 tags from the forum to apply to the thread. */
|
|
1005
|
+
appliedTags?: Array<string>;
|
|
1006
|
+
/** The message to start the thread with. */
|
|
1007
|
+
message: ThreadOnlyChannelThreadStarterMessageOptions;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
export type ThreadOnlyChannelThreadStarterMessageOptions = Pick<CreateMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "stickerIDs" | "attachments" | "flags" | "files">;
|
|
1011
|
+
|
|
1012
|
+
export interface GetArchivedThreadsOptions {
|
|
1013
|
+
/** A **timestamp** to get threads before. */
|
|
1014
|
+
before?: string;
|
|
1015
|
+
/** The maximum amount of threads to get. */
|
|
1016
|
+
limit?: number;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
export interface RawArchivedThreads<T extends RawAnnouncementThreadChannel | RawPublicThreadChannel | RawPrivateThreadChannel> {
|
|
1020
|
+
has_more: boolean;
|
|
1021
|
+
members: Array<RawThreadMember>;
|
|
1022
|
+
threads: Array<T>;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
export interface ArchivedThreads<T extends AnnouncementThreadChannel | PublicThreadChannel | PrivateThreadChannel> {
|
|
1026
|
+
hasMore: boolean;
|
|
1027
|
+
members: Array<ThreadMember>;
|
|
1028
|
+
threads: Array<T>;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
export interface GetInviteOptions {
|
|
1032
|
+
/** The id of the guild scheduled event to include with the invite. */
|
|
1033
|
+
guildScheduledEventID?: string;
|
|
1034
|
+
/** If the invite should contain approximate member counts. */
|
|
1035
|
+
withCounts?: boolean;
|
|
1036
|
+
/** If the invite should contain expiration data. */
|
|
1037
|
+
withExpiration?: boolean;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
export interface GetInviteWithCountsOptions extends Omit<GetInviteOptions, "withCounts"> {
|
|
1041
|
+
/** If the invite should contain approximate member counts. */
|
|
1042
|
+
withCounts: true;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
export interface GetInviteWithExpirationOptions extends Omit<GetInviteOptions, "withExpiration"> {
|
|
1046
|
+
/** If the invite should contain expiration data. */
|
|
1047
|
+
withExpiration: true;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
export interface GetInviteWithCountsAndExpirationOptions extends Omit<GetInviteOptions, "withCounts" | "withExpiration"> {
|
|
1052
|
+
/** If the invite should contain approximate member counts. */
|
|
1053
|
+
withCounts: true;
|
|
1054
|
+
/** If the invite should contain expiration data. */
|
|
1055
|
+
withExpiration: true;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
export interface GetInviteWithNoneOptions extends Omit<GetInviteOptions, "withCounts" | "withExpiration"> {
|
|
1060
|
+
/** If the invite should contain approximate member counts. */
|
|
1061
|
+
withCounts?: false;
|
|
1062
|
+
/** If the invite should contain expiration data. */
|
|
1063
|
+
withExpiration?: false;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// for the love of god find a way to make this not so shit
|
|
1067
|
+
export type InviteInfoTypes = "withMetadata" | "withCounts" | "withoutCounts" | "withExpiration" | "withoutExpiration";
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
export interface ThreadMetadata {
|
|
1071
|
+
archiveTimestamp: Date;
|
|
1072
|
+
archived: boolean;
|
|
1073
|
+
autoArchiveDuration: ThreadAutoArchiveDuration;
|
|
1074
|
+
createTimestamp: Date | null;
|
|
1075
|
+
locked: boolean;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
export interface PrivateThreadMetadata extends ThreadMetadata {
|
|
1079
|
+
invitable: boolean;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
export interface RawForumTag {
|
|
1083
|
+
emoji_id: string | null;
|
|
1084
|
+
emoji_name: string | null;
|
|
1085
|
+
id: string;
|
|
1086
|
+
moderated: boolean;
|
|
1087
|
+
name: string;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
export interface ForumTag {
|
|
1091
|
+
/** The emoji for this tag. */
|
|
1092
|
+
emoji: ForumEmoji | null;
|
|
1093
|
+
/** The ID of this tag. */
|
|
1094
|
+
id: string;
|
|
1095
|
+
/** If this tag can only be used by moderators. */
|
|
1096
|
+
moderated: boolean;
|
|
1097
|
+
/** The name of this tag. */
|
|
1098
|
+
name: string;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
export interface ForumEmoji {
|
|
1102
|
+
/** The ID of this emoji if custom, null otherwise. */
|
|
1103
|
+
id: string | null;
|
|
1104
|
+
/** The unicode codepoint of this emoji if default, null otherwise. */
|
|
1105
|
+
name: string | null;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
export type PossiblyUncachedMessage = Message | UncachedEventMessage;
|
|
1109
|
+
export type PossiblyUncachedThread = AnyThreadChannel | UncachedEventThread;
|
|
1110
|
+
export type MinimalPossiblyUncachedThread = AnyThreadChannel | MinimalPossiblyUncachedEventThread;
|
|
1111
|
+
|
|
1112
|
+
export interface UncachedEventMessage extends Uncached {
|
|
1113
|
+
channel: AnyTextableChannel | Uncached;
|
|
1114
|
+
channelID: string;
|
|
1115
|
+
guild?: Guild;
|
|
1116
|
+
guildID?: string;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
export interface UncachedEventThread extends Pick<AnyThreadChannel, "type">, Uncached {
|
|
1120
|
+
guild?: Guild;
|
|
1121
|
+
guildID?: string;
|
|
1122
|
+
parent?: ThreadParentChannel | Uncached;
|
|
1123
|
+
parentID: string;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
export interface MinimalPossiblyUncachedEventThread extends Uncached {
|
|
1127
|
+
guild?: Guild;
|
|
1128
|
+
guildID: string;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
export interface PurgeOptions<T extends AnyTextableGuildChannel | Uncached> {
|
|
1132
|
+
/** The ID of the message to purge after. */
|
|
1133
|
+
after?: string;
|
|
1134
|
+
/** The ID of the message to purge around. */
|
|
1135
|
+
around?: string;
|
|
1136
|
+
/** The ID of the message to purge before. */
|
|
1137
|
+
before?: string;
|
|
1138
|
+
/** The limit of messages to purge. */
|
|
1139
|
+
limit: number;
|
|
1140
|
+
/** The reason for purging the messages. */
|
|
1141
|
+
reason?: string;
|
|
1142
|
+
/**
|
|
1143
|
+
* A function used to reject certain messages. If `"break"` is returned, further iteration of messages will stop and purging will begin immediately.
|
|
1144
|
+
* @param message The message to filter.
|
|
1145
|
+
*/
|
|
1146
|
+
filter?(message: Message<T>): boolean | "break" | PromiseLike<boolean | "break">;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export type ThreadParentChannel = TextChannel | AnnouncementChannel | ForumChannel;
|
|
1150
|
+
|
|
1151
|
+
export interface RawRoleSubscriptionData {
|
|
1152
|
+
is_renewal: boolean;
|
|
1153
|
+
role_subscription_listing_id: string;
|
|
1154
|
+
tier_name: string;
|
|
1155
|
+
total_months_subscribed: number;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
export interface RoleSubscriptionData {
|
|
1159
|
+
isRenewal: boolean;
|
|
1160
|
+
roleSubscriptionListingID: string;
|
|
1161
|
+
tierName: string;
|
|
1162
|
+
totalMonthsSubscribed: number;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
export interface MessagePollOptions {
|
|
1166
|
+
/** If multiple votes can be selected. */
|
|
1167
|
+
allowMultiselect: boolean;
|
|
1168
|
+
/** The answers for this poll. Up to 10 can be specified. */
|
|
1169
|
+
answers: Array<PollAnswerOption>;
|
|
1170
|
+
/** The duration of this poll in hours. Up to 7 days (168 hours) */
|
|
1171
|
+
duration: number;
|
|
1172
|
+
layoutType?: PollLayoutType;
|
|
1173
|
+
/** The question for the poll. */
|
|
1174
|
+
question: PollQuestion;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
export interface GetPollAnswerUsersOptions {
|
|
1178
|
+
/** Get members after this member id. */
|
|
1179
|
+
after?: string;
|
|
1180
|
+
/** The maximum number of users returned, defaults to 100. */
|
|
1181
|
+
limit?: number;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
export interface RawPoll {
|
|
1185
|
+
allow_multiselect: boolean;
|
|
1186
|
+
answers: Array<RawPollAnswer>;
|
|
1187
|
+
expiry: string;
|
|
1188
|
+
layout_type: PollLayoutType;
|
|
1189
|
+
question: PollQuestion;
|
|
1190
|
+
results?: RawPollResults;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
export interface RawPollAnswer {
|
|
1194
|
+
answer_id: number;
|
|
1195
|
+
poll_media: PollMedia;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
export interface RawPollResults {
|
|
1199
|
+
answer_counts: Array<RawPollAnswerCount>;
|
|
1200
|
+
is_finalized: boolean;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
export interface PollMedia {
|
|
1204
|
+
/** The emoji to dispaly. */
|
|
1205
|
+
emoji?: NullablePartialEmoji;
|
|
1206
|
+
// @FIXME: Discord has said this is currently always nonnull, but not to depend on that in the future (https://github.com/discord/discord-api-docs/pull/6746)
|
|
1207
|
+
/** The text. */
|
|
1208
|
+
text: string;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
export interface PollQuestion extends Pick<PollMedia, "text"> {}
|
|
1212
|
+
|
|
1213
|
+
export interface PollAnswer {
|
|
1214
|
+
/** The id of this answer in relation to `results.answerCounts.id`. */
|
|
1215
|
+
answerID: number;
|
|
1216
|
+
/** The media object for this answer. */
|
|
1217
|
+
pollMedia: PollMedia;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
export interface PollAnswerOption extends Pick<PollAnswer, "pollMedia"> {}
|
|
1221
|
+
|
|
1222
|
+
export interface RawPollAnswerCount {
|
|
1223
|
+
count: number;
|
|
1224
|
+
id: number;
|
|
1225
|
+
me_voted: boolean;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
export interface PollResults {
|
|
1229
|
+
/** The counts for each answer. */
|
|
1230
|
+
answerCounts: Array<PollAnswerCount>;
|
|
1231
|
+
/** If the poll has been finalized. */
|
|
1232
|
+
isFinalized: boolean;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
export interface PollAnswerCount {
|
|
1236
|
+
/** The count for this answer. */
|
|
1237
|
+
count: number;
|
|
1238
|
+
/** The id of this answer in relation to `answers.answerID`. */
|
|
1239
|
+
id: number;
|
|
1240
|
+
/** If the current user has voted for this answer. */
|
|
1241
|
+
meVoted: boolean;
|
|
1242
|
+
/** The IDs of the users that voted. This will always be out of sync unless you either {@link Poll#getAnswerUsers | fetch the answer voters over REST}, or if the poll was created after the bot started, and stays in the cache. */
|
|
1243
|
+
users: Array<string>;
|
|
1244
|
+
}
|