oceanic.js 0.0.12-dev.b566fc5 → 0.0.12-dev.bcdbabd
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/.github/workflows/dev-publish.yml +4 -1
- package/.github/workflows/docs.yml +14 -0
- package/CONTRIBUTING.md +10 -0
- package/README.md +7 -2
- package/dist/lib/Client.d.ts +6 -4
- package/dist/lib/Client.js +41 -22
- package/dist/lib/Constants.d.ts +4 -2
- package/dist/lib/Constants.js +3 -1
- package/dist/lib/gateway/Shard.d.ts +4 -4
- package/dist/lib/gateway/Shard.js +157 -88
- package/dist/lib/gateway/ShardManager.js +26 -14
- package/dist/lib/rest/Bucket.js +7 -4
- package/dist/lib/rest/DiscordHTTPError.d.ts +3 -3
- package/dist/lib/rest/DiscordHTTPError.js +24 -11
- package/dist/lib/rest/DiscordRESTError.d.ts +3 -3
- package/dist/lib/rest/DiscordRESTError.js +30 -14
- package/dist/lib/rest/RESTManager.d.ts +1 -1
- package/dist/lib/rest/RESTManager.js +7 -3
- package/dist/lib/rest/RequestHandler.js +56 -29
- package/dist/lib/rest/SequentialBucket.js +13 -7
- package/dist/lib/routes/ApplicationCommands.d.ts +12 -12
- package/dist/lib/routes/ApplicationCommands.js +26 -20
- package/dist/lib/routes/Channels.d.ts +11 -9
- package/dist/lib/routes/Channels.js +38 -27
- package/dist/lib/routes/Guilds.d.ts +36 -35
- package/dist/lib/routes/Guilds.js +121 -71
- package/dist/lib/routes/Interactions.d.ts +6 -5
- package/dist/lib/routes/Interactions.js +4 -4
- package/dist/lib/routes/OAuth.d.ts +6 -4
- package/dist/lib/routes/OAuth.js +18 -10
- package/dist/lib/routes/Users.d.ts +6 -1
- package/dist/lib/routes/Users.js +7 -2
- package/dist/lib/routes/Webhooks.d.ts +3 -3
- package/dist/lib/routes/Webhooks.js +39 -22
- package/dist/lib/structures/AnnouncementChannel.d.ts +2 -1
- package/dist/lib/structures/AnnouncementChannel.js +1 -1
- package/dist/lib/structures/Application.js +35 -18
- package/dist/lib/structures/ApplicationCommand.d.ts +8 -4
- package/dist/lib/structures/ApplicationCommand.js +13 -4
- package/dist/lib/structures/AutoModerationRule.d.ts +1 -1
- package/dist/lib/structures/AutoModerationRule.js +17 -9
- package/dist/lib/structures/AutocompleteInteraction.js +3 -2
- package/dist/lib/structures/Base.js +1 -1
- package/dist/lib/structures/CategoryChannel.js +17 -9
- package/dist/lib/structures/Channel.js +1 -2
- package/dist/lib/structures/ClientApplication.d.ts +21 -19
- package/dist/lib/structures/ClientApplication.js +16 -15
- package/dist/lib/structures/CommandInteraction.js +27 -14
- package/dist/lib/structures/ComponentInteraction.js +11 -6
- package/dist/lib/structures/ExtendedUser.js +7 -4
- package/dist/lib/structures/ForumChannel.d.ts +2 -2
- package/dist/lib/structures/ForumChannel.js +35 -18
- package/dist/lib/structures/GroupChannel.d.ts +6 -5
- package/dist/lib/structures/GroupChannel.js +21 -11
- package/dist/lib/structures/Guild.d.ts +44 -46
- package/dist/lib/structures/Guild.js +117 -55
- package/dist/lib/structures/GuildChannel.js +3 -2
- package/dist/lib/structures/GuildPreview.js +21 -11
- package/dist/lib/structures/GuildScheduledEvent.js +27 -14
- package/dist/lib/structures/GuildTemplate.js +13 -7
- package/dist/lib/structures/Integration.js +29 -15
- package/dist/lib/structures/Invite.js +36 -19
- package/dist/lib/structures/Member.d.ts +6 -3
- package/dist/lib/structures/Member.js +64 -24
- package/dist/lib/structures/Message.d.ts +6 -4
- package/dist/lib/structures/Message.js +89 -33
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +6 -5
- package/dist/lib/structures/ModalSubmitInteraction.js +9 -5
- package/dist/lib/structures/PartialApplication.js +11 -6
- package/dist/lib/structures/Permission.d.ts +3 -2
- package/dist/lib/structures/Permission.js +9 -5
- package/dist/lib/structures/PermissionOverwrite.d.ts +2 -2
- package/dist/lib/structures/PermissionOverwrite.js +10 -6
- package/dist/lib/structures/PingInteraction.d.ts +1 -1
- package/dist/lib/structures/PingInteraction.js +1 -1
- package/dist/lib/structures/PrivateChannel.d.ts +3 -3
- package/dist/lib/structures/PrivateChannel.js +3 -2
- package/dist/lib/structures/Role.js +19 -10
- package/dist/lib/structures/StageChannel.d.ts +3 -2
- package/dist/lib/structures/StageChannel.js +21 -11
- package/dist/lib/structures/StageInstance.js +11 -6
- package/dist/lib/structures/Team.js +9 -5
- package/dist/lib/structures/TextChannel.d.ts +12 -2
- package/dist/lib/structures/TextChannel.js +15 -1
- package/dist/lib/structures/TextableChannel.d.ts +5 -14
- package/dist/lib/structures/TextableChannel.js +25 -27
- package/dist/lib/structures/ThreadChannel.d.ts +5 -4
- package/dist/lib/structures/ThreadChannel.js +21 -11
- package/dist/lib/structures/User.d.ts +2 -1
- package/dist/lib/structures/User.js +13 -7
- package/dist/lib/structures/VoiceChannel.d.ts +7 -5
- package/dist/lib/structures/VoiceChannel.js +27 -14
- package/dist/lib/structures/VoiceState.js +23 -12
- package/dist/lib/structures/Webhook.js +20 -10
- package/dist/lib/types/application-commands.d.ts +35 -25
- package/dist/lib/types/channels.d.ts +6 -1
- package/dist/lib/types/client.d.ts +2 -232
- package/dist/lib/types/events.d.ts +233 -0
- package/dist/lib/types/guilds.d.ts +1 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/oauth.d.ts +5 -2
- package/dist/lib/types/request-handler.d.ts +2 -1
- package/dist/lib/types/shared.d.ts +6 -0
- package/dist/lib/util/Collection.d.ts +3 -2
- package/dist/lib/util/Collection.js +12 -6
- package/dist/lib/util/InteractionOptionsWrapper.js +68 -41
- package/dist/lib/util/Routes.d.ts +1 -0
- package/dist/lib/util/Routes.js +5 -2
- package/dist/lib/util/TypedCollection.js +12 -7
- package/dist/lib/util/TypedEmitter.js +3 -3
- package/dist/lib/util/Util.js +108 -132
- package/dist/lib/voice/VoiceConnection.d.ts +2 -1
- package/dist/lib/voice/VoiceConnection.js +2 -1
- package/dist/package.json +8 -10
- package/doc-test.js +39 -0
- package/esm.mjs +1 -1
- package/examples/applicationCommand.js +4 -4
- package/examples/components.js +4 -4
- package/examples/embeds.js +3 -4
- package/examples/intents.js +8 -10
- package/package.json +8 -10
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AnyGuildChannelWithoutThreads,
|
|
3
|
+
AnyGuildTextChannel,
|
|
4
|
+
AnyTextChannel,
|
|
5
|
+
AnyThreadChannel,
|
|
6
|
+
InviteChannel,
|
|
7
|
+
PossiblyUncachedMessage,
|
|
8
|
+
PossiblyUncachedThread,
|
|
9
|
+
ThreadMember
|
|
10
|
+
} from "./channels";
|
|
11
|
+
import type { RawRequest } from "./request-handler";
|
|
12
|
+
import type { AutoModerationActionExecution, Presence } from "./gateway";
|
|
13
|
+
import type { AnyDispatchPacket } from "./gateway-raw";
|
|
14
|
+
import type { Uncached } from "./shared";
|
|
15
|
+
import type {
|
|
16
|
+
JSONAnnouncementChannel,
|
|
17
|
+
JSONAnnouncementThreadChannel,
|
|
18
|
+
JSONAutoModerationRule,
|
|
19
|
+
JSONCategoryChannel,
|
|
20
|
+
JSONGuild,
|
|
21
|
+
JSONIntegration,
|
|
22
|
+
JSONMember,
|
|
23
|
+
JSONMessage,
|
|
24
|
+
JSONPrivateThreadChannel,
|
|
25
|
+
JSONPublicThreadChannel,
|
|
26
|
+
JSONRole,
|
|
27
|
+
JSONScheduledEvent,
|
|
28
|
+
JSONStageChannel,
|
|
29
|
+
JSONStageInstance,
|
|
30
|
+
JSONTextChannel,
|
|
31
|
+
JSONUser,
|
|
32
|
+
JSONVoiceChannel,
|
|
33
|
+
JSONVoiceState
|
|
34
|
+
} from "./json";
|
|
35
|
+
import type { GuildApplicationCommandPermissions } from "./application-commands";
|
|
36
|
+
import type { GuildEmoji, PartialEmoji, Sticker } from "./guilds";
|
|
37
|
+
import type { AnyInteractionGateway } from "./interactions";
|
|
38
|
+
import type Guild from "../structures/Guild";
|
|
39
|
+
import type UnavailableGuild from "../structures/UnavailableGuild";
|
|
40
|
+
import type AutoModerationRule from "../structures/AutoModerationRule";
|
|
41
|
+
import type AnnouncementThreadChannel from "../structures/AnnouncementThreadChannel";
|
|
42
|
+
import type PublicThreadChannel from "../structures/PublicThreadChannel";
|
|
43
|
+
import type PrivateThreadChannel from "../structures/PrivateThreadChannel";
|
|
44
|
+
import type TextChannel from "../structures/TextChannel";
|
|
45
|
+
import type VoiceChannel from "../structures/VoiceChannel";
|
|
46
|
+
import type CategoryChannel from "../structures/CategoryChannel";
|
|
47
|
+
import type AnnouncementChannel from "../structures/AnnouncementChannel";
|
|
48
|
+
import type StageChannel from "../structures/StageChannel";
|
|
49
|
+
import type User from "../structures/User";
|
|
50
|
+
import type Member from "../structures/Member";
|
|
51
|
+
import type Role from "../structures/Role";
|
|
52
|
+
import type GuildScheduledEvent from "../structures/GuildScheduledEvent";
|
|
53
|
+
import type Integration from "../structures/Integration";
|
|
54
|
+
import type Invite from "../structures/Invite";
|
|
55
|
+
import type Message from "../structures/Message";
|
|
56
|
+
import type PrivateChannel from "../structures/PrivateChannel";
|
|
57
|
+
import type StageInstance from "../structures/StageInstance";
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export interface ClientEvents {
|
|
61
|
+
/** @event Emitted when an application command's permissions are updated. */
|
|
62
|
+
applicationCommandPermissionsUpdate: [guild: Guild, permissions: GuildApplicationCommandPermissions];
|
|
63
|
+
/** @event Emitted when an auto moderation action is executed. Requires the `AUTO_MODERATION_EXECUTION` intent. */
|
|
64
|
+
autoModerationActionExecution: [guild: Guild, channel: AnyGuildTextChannel | Uncached | null, user: User | Uncached, executionOptions: AutoModerationActionExecution];
|
|
65
|
+
/** @event Emitted when an auto moderation rule is created. Requires the `AUTO_MODERATION_CONFIGURATION` intent. */
|
|
66
|
+
autoModerationRuleCreate: [rule: AutoModerationRule];
|
|
67
|
+
/** @event Emitted when an auto moderation rule is deleted. Requires the `AUTO_MODERATION_CONFIGURATION` intent. */
|
|
68
|
+
autoModerationRuleDelete: [rule: AutoModerationRule];
|
|
69
|
+
/** @event Emitted when an auto moderaiton rule is updated. Requires the `AUTO_MODERATION_CONFIGURATION` intent. */
|
|
70
|
+
autoModerationRuleUpdate: [rule: AutoModerationRule, oldRule: JSONAutoModerationRule | null];
|
|
71
|
+
/** @event Emitted when a channel is created. Requires the `GUILDS` intent. */
|
|
72
|
+
channelCreate: [channel: AnyGuildChannelWithoutThreads];
|
|
73
|
+
/** @event Emitted when channel is deleted. Requires the `GUILDS` intent. */
|
|
74
|
+
channelDelete: [channel: AnyGuildChannelWithoutThreads];
|
|
75
|
+
/** @event Emitted when a channel's pins are updated (message pinned, message unpinned). Requires the `GUILDS` intent for guild channels, and `DIRECT_MESSAGES` for direct messages. */
|
|
76
|
+
channelPinsUpdate: [channel: AnyTextChannel, timestamp: Date | null];
|
|
77
|
+
/** @event Emitted when a channel is updated. Requires the `GUILDS` intent. */
|
|
78
|
+
channelUpdate: [channel: TextChannel, oldChannel: JSONTextChannel | null] | [channel: VoiceChannel, oldChannel: JSONVoiceChannel | null] | [channel: CategoryChannel, oldChannel: JSONCategoryChannel | null] | [channel: AnnouncementChannel, oldChannel: JSONAnnouncementChannel | null] | [channel: StageChannel, oldChannel: JSONStageChannel | null];
|
|
79
|
+
/** @event Emitted when a shard connects. */
|
|
80
|
+
connect: [id: number];
|
|
81
|
+
/** @event Emitted with various information for debugging. */
|
|
82
|
+
debug: [info: string, shard?: number];
|
|
83
|
+
/** @event Emitted when all shards disconnect. */
|
|
84
|
+
disconnect: [];
|
|
85
|
+
/** @event Emitted when an error happens. */
|
|
86
|
+
error: [info: Error | string, shard?: number];
|
|
87
|
+
/** @event Eitted when a guild becoms available. Requires the `GUILDS` intent. */
|
|
88
|
+
guildAvailable: [guild: Guild];
|
|
89
|
+
/** @event Emitted when a guild ban is created. Requires the `GUILD_BANS` intent. */
|
|
90
|
+
guildBanAdd: [guild: Guild, user: User];
|
|
91
|
+
/** @event Emitted when a guild ban is revoked. Requires the `GUILD_BANS` intent. */
|
|
92
|
+
guildBanRemove: [guild: Guild, user: User];
|
|
93
|
+
/** @event Emitted when the client joins a new guild. Requires the `GUILDS` intent. */
|
|
94
|
+
guildCreate: [guild: Guild];
|
|
95
|
+
/** @event Emitted when the client leaves a guild. Requires the `GUILDS` intent. */
|
|
96
|
+
guildDelete: [guild: Guild | Uncached];
|
|
97
|
+
/** @event Emitted when a guild's emojis are updated. Requires the `GUILD_EMOJIS_AND_STICKERS` intent. */
|
|
98
|
+
guildEmojisUpdate: [guild: Guild, emojis: Array<GuildEmoji>, oldEmojis: Array<GuildEmoji>];
|
|
99
|
+
/** @event Emitted when a guild's integrations are updated. Requires the `GUILD_INTEGRATOPMS` intent. */
|
|
100
|
+
guildIntegrationsUpdate: [guild: Guild];
|
|
101
|
+
/** @event Emitted when a member joins a guild. Requires the `GUILD_MEMBERS` intent. */
|
|
102
|
+
guildMemberAdd: [member: Member];
|
|
103
|
+
/** @event Emitted when a chunk of guild members is received from Discord. */
|
|
104
|
+
guildMemberChunk: [guild: Guild, members: Array<Member>];
|
|
105
|
+
/** @event Emitted when a member leaves a guild. Requires the `GUILD_MEMBERS` intent. If the member is uncached, the first parameter will be a user. If the guild is uncached, the first parameter will be a user, and the second will be an object with only an `id`. */
|
|
106
|
+
guildMemberRemove: [member: Member | User, guild: Guild | Uncached];
|
|
107
|
+
/** @event Emitted when a guild member is updates. Requires the `GUILD_MEMBERS` intent.*/
|
|
108
|
+
guildMemberUpdate: [member: Member, oldMember: JSONMember | null];
|
|
109
|
+
/** @event Emitted when a role is created. Requires the `GUILDS` intent. */
|
|
110
|
+
guildRoleCreate: [role: Role];
|
|
111
|
+
/** @event Emitted when a role is deleted. Requires the `GUILDS` intent. */
|
|
112
|
+
guildRoleDelete: [role: Role];
|
|
113
|
+
/** @event Emitted when a role is updated. Requires the `GUILDS` intent. */
|
|
114
|
+
guildRoleUpdate: [role: Role, oldRole: JSONRole | null];
|
|
115
|
+
/** @event Emitted when a scheduled event is created. Requires the `GUILD_SCHEDULED_EVENTS` intent. */
|
|
116
|
+
guildScheduledEventCreate: [event: GuildScheduledEvent];
|
|
117
|
+
/** @event Emitted when a scheduled event is deleted. Requires the `GUILD_SCHEDULED_EVENTS` intent. */
|
|
118
|
+
guildScheduledEventDelete: [event: GuildScheduledEvent];
|
|
119
|
+
/** @event Emitted when a scheduled event is updated. Requires the `GUILD_SCHEDULED_EVENTS` intent. */
|
|
120
|
+
guildScheduledEventUpdate: [event: GuildScheduledEvent, oldEvent: JSONScheduledEvent | null];
|
|
121
|
+
/** @event Emitted when a user subscribes to a scheduled event. Requires the `GUILD_SCHEDULED_EVENTS` intent. */
|
|
122
|
+
guildScheduledEventUserAdd: [event: GuildScheduledEvent | Uncached, user: User | Uncached];
|
|
123
|
+
/** @event Emitted when a user unsubscribes from a scheduled event. Requires the `GUILD_SCHEDULED_EVENTS` intent. */
|
|
124
|
+
guildScheduledEventUserRemove: [event: GuildScheduledEvent | Uncached, user: User | Uncached];
|
|
125
|
+
/** @event Emitted when a guild's stickers are updated. Requires the `GUILD_EMOJIS_AND_STICKERS` intent. */
|
|
126
|
+
guildStickersUpdate: [guild: Guild, stickers: Array<Sticker>, oldStickers: Array<Sticker>];
|
|
127
|
+
/** @event Emitted when a guild becomes unavailable. Requires the `GUILDS` intent. */
|
|
128
|
+
guildUnavailable: [guild: UnavailableGuild];
|
|
129
|
+
/** @event Emitted when a guild is updated. Requires the `GUILDS` intent. */
|
|
130
|
+
guildUpdate: [guild: Guild, oldGuild: JSONGuild | null];
|
|
131
|
+
/** @event Emitted when a shard receives the HELLO packet. */
|
|
132
|
+
hello: [interval: number, shard: number];
|
|
133
|
+
/** @event Emitted when an integration is created. Requires the `GUILD_INTEGRATIONS` intent. */
|
|
134
|
+
integrationCreate: [guild: Guild, integration: Integration];
|
|
135
|
+
/** @event Emitted when an integration is deleted. Requires the `GUILD_INTEGRATIONS` intent. */
|
|
136
|
+
integrationDelete: [guild: Guild, integration: Integration | { applicationID?: string; id: string; }];
|
|
137
|
+
/** @event Emitted when an integration is updated. Requires the `GUILD_INTEGRATIONS` intent. */
|
|
138
|
+
integrationUpdate: [guild: Guild, integration: Integration, oldIntegration: JSONIntegration | null];
|
|
139
|
+
/** @event Emitted when an interaction is created. */
|
|
140
|
+
interactionCreate: [interaction: AnyInteractionGateway];
|
|
141
|
+
/** @event Emitted when an invite is created. Requires the `GUILD_INVITES` intent. */
|
|
142
|
+
inviteCreate: [guild: Guild | null, channel: InviteChannel, invite: Invite];
|
|
143
|
+
/** @event Emitted when an invite is deleted. Requires the `GUILD_INVITES` intent. */
|
|
144
|
+
inviteDelete: [guild: Guild | null, channel: InviteChannel, code: string];
|
|
145
|
+
/** @event Emitted when a message is created. Requires the `GUILD_MESSAGES` intent for guild messages, `DIRECT_MESSAGES` for direct messages. The `MESSAGE_CONTENT` intent is required for `content`, `embeds`, and similar to be present on most messages. */
|
|
146
|
+
messageCreate: [message: Message];
|
|
147
|
+
/** @event Emitted when a message is created. Requires the `GUILD_MESSAGES` intent for guild messages, `DIRECT_MESSAGES` for direct messages. The `MESSAGE_CONTENT` intent is required for `content`, `embeds`, and similar to be present on most messages. */
|
|
148
|
+
messageDelete: [message: PossiblyUncachedMessage];
|
|
149
|
+
/** @event Emitted when messages are bulk deleted. Requires the `GUILD_MESSAGES` intent. The `MESSAGE_CONTENT` intent is required for `content`, `embeds`, and similar to be present on most messages. */
|
|
150
|
+
messageDeleteBulk: [messages: Array<PossiblyUncachedMessage>];
|
|
151
|
+
/** @event Emitted when a reaction is added to a message. Requires the `GUILD_MESSAGE_REACTIONS` for guild messages, and `DIRECT_MESSAGE_REACTIONS` for direct messages. */
|
|
152
|
+
messageReactionAdd: [message: PossiblyUncachedMessage, reactor: Member | User | Uncached, reaction: PartialEmoji];
|
|
153
|
+
/** @event Emitted when a reaction is removed from a message. Requires the `GUILD_MESSAGE_REACTIONS` for guild messages, and `DIRECT_MESSAGE_REACTIONS` for direct messages. */
|
|
154
|
+
messageReactionRemove: [message: PossiblyUncachedMessage, reactor: Member | User | Uncached, reaction: PartialEmoji];
|
|
155
|
+
/** @event Emitted when all reactions are removed from a message. Requires the `GUILD_MESSAGE_REACTIONS` for guild messages, and `DIRECT_MESSAGE_REACTIONS` for direct messages. */
|
|
156
|
+
messageReactionRemoveAll: [message: PossiblyUncachedMessage];
|
|
157
|
+
/** @event Emitted when a specific reaction is removed for all users from a message. Requires the `GUILD_MESSAGE_REACTIONS` for guild messages, and `DIRECT_MESSAGE_REACTIONS` for direct messages. */
|
|
158
|
+
messageReactionRemoveEmoji: [message: PossiblyUncachedMessage, reaction: PartialEmoji];
|
|
159
|
+
/** @event Emitted when a message is updated. Requires the `GUILD_MESSAGES` intent for guild messages, `DIRECT_MESSAGES` for direct messages. The `MESSAGE_CONTENT` intent is required for `content`, `embeds`, and similar to be present on most messages. */
|
|
160
|
+
messageUpdate: [message: Message, oldMessage: JSONMessage | null];
|
|
161
|
+
/** @event Emitted when a raw dispatch packet is received. */
|
|
162
|
+
packet: [data: AnyDispatchPacket, shard: number];
|
|
163
|
+
/** @event Emitted when a guild member's presence, or user is updated. Requires the `GUILD_PRESENCES` intent. */
|
|
164
|
+
presenceUpdate: [guild: Guild, member: Member, presence: Presence, oldPresence: Presence | null];
|
|
165
|
+
/** @event Emitted when all shards are ready. */
|
|
166
|
+
ready: [];
|
|
167
|
+
/** @event Emitted when a request is made. */
|
|
168
|
+
request: [rawRequest: RawRequest];
|
|
169
|
+
/** @event Emitted when this shard disconnects.*/
|
|
170
|
+
shardDisconnect: [err: Error | undefined, id: number];
|
|
171
|
+
/** @event Emitted when this shard has processed the READY packet from Discord. */
|
|
172
|
+
shardPreReady: [id: number];
|
|
173
|
+
/** @event Emitted when a shard is fully ready. */
|
|
174
|
+
shardReady: [id: number];
|
|
175
|
+
/** @event Emitted when a shard resumes a connection. */
|
|
176
|
+
shardResume: [id: number];
|
|
177
|
+
/** @event Emitted when a stage instance is created. */
|
|
178
|
+
stageInstanceCreate: [instance: StageInstance];
|
|
179
|
+
/** @event Emitted when a stage instance is deleted. */
|
|
180
|
+
stageInstanceDelete: [instance: StageInstance];
|
|
181
|
+
/** @event Emitted when a stage instance is updated. */
|
|
182
|
+
stageInstanceUpdate: [instance: StageInstance, oldInstance: JSONStageInstance | null];
|
|
183
|
+
/** @event Emitted when a thread is created. Requires the `GUILDS` intent. */
|
|
184
|
+
threadCreate: [thread: AnyThreadChannel];
|
|
185
|
+
/** @event Emitted when a thread is deleted. Requires the `GUILDS` intent. */
|
|
186
|
+
threadDelete: [thread: PossiblyUncachedThread];
|
|
187
|
+
/** @event Emitted when a guild's threads are synced. Requires the `GUILDS` intent. */
|
|
188
|
+
threadListSync: [threads: Array<AnyThreadChannel>, members: Array<ThreadMember>];
|
|
189
|
+
/** @event Emitted when a thread member is updated. Requires the `GUILDS` intent. */
|
|
190
|
+
threadMemberUpdate: [thread: AnyThreadChannel, member: ThreadMember, oldMember: ThreadMember | null];
|
|
191
|
+
/** @event Emitted when the members of a thread are updated. Requires the `GUILDS` intent. The received information will be different if `GUILD_MEMBERS` is also used. */
|
|
192
|
+
threadMembersUpdate: [thread: AnyThreadChannel, addedMembers: Array<ThreadMember>, removedMembers: Array<ThreadMember>];
|
|
193
|
+
/** @event Emitted when a thread is updated. Requires the `GUILDS` intent. */
|
|
194
|
+
threadUpdate: [thread: AnnouncementThreadChannel, oldThread: JSONAnnouncementThreadChannel] | [thread: PublicThreadChannel, oldThread: JSONPublicThreadChannel | null] | [thread: PrivateThreadChannel | null, oldThread: JSONPrivateThreadChannel | null];
|
|
195
|
+
/** @event Emitted when a user starts typing. Requires the `GUILD_MESSAGE_TYPING` for guilds, and `DIRECT_MESSAGE_TYPING` for direct messages. */
|
|
196
|
+
typingStart: [channel: PrivateChannel | Uncached, user: User | Uncached, startTimestamp: Date] | [channel: AnyGuildTextChannel | Uncached, member: Member, startTimestamp: Date];
|
|
197
|
+
/** @event Emitted when a guild is created, but is unavailable. Requires the `GUILDS` intent.*/
|
|
198
|
+
unavailableGuildCreate: [guild: UnavailableGuild];
|
|
199
|
+
/** @event Emitted when a user is updated. */
|
|
200
|
+
userUpdate: [user: User, oldUser: JSONUser | null];
|
|
201
|
+
/** @event Emitted when a user joins a voice channel. Requires the `GUILD_VOICE_STATES` intent. */
|
|
202
|
+
voiceChannelJoin: [member: Member, channel: VoiceChannel | StageChannel];
|
|
203
|
+
/** @event Emitted when a user leaves a voice channel. Requires the `GUILD_VOICE_STATES` intent. */
|
|
204
|
+
voiceChannelLeave: [member: Member, channel: VoiceChannel | StageChannel];
|
|
205
|
+
/** @event Emitted when a user switches voice channels. Requires the `GUILD_VOICE_STATES` intent. */
|
|
206
|
+
voiceChannelSwitch: [member: Member, channel: VoiceChannel | StageChannel, oldChannel: VoiceChannel | StageChannel | null];
|
|
207
|
+
/** @event Emitted when a user's voice state is updated. Requires the `GUILD_VOICE_STATES` intent. */
|
|
208
|
+
voiceStateUpdate: [member: Member, oldState: JSONVoiceState | null];
|
|
209
|
+
/** @event Emitted with various warning information. */
|
|
210
|
+
warn: [info: string, shard?: number];
|
|
211
|
+
/** @event Emitted when a guild's webhooks are updated. Requires the `GUILD_WEBHOOKS` intent. */
|
|
212
|
+
webhooksUpdate: [guild: Guild, channel: AnyGuildChannelWithoutThreads | Uncached];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface ShardEvents {
|
|
216
|
+
/** @event Emitted with various information for debugging. */
|
|
217
|
+
debug: [info: string];
|
|
218
|
+
/** @event Emitted when this shard disconnects.*/
|
|
219
|
+
disconnect: [err?: Error];
|
|
220
|
+
/** @event Emitted when an error happens. */
|
|
221
|
+
error: [info: Error | string];
|
|
222
|
+
/** @event Emitted when this shard has processed the READY packet from Discord. */
|
|
223
|
+
preReady: [];
|
|
224
|
+
/** @event Emitted when this shard is fully ready. */
|
|
225
|
+
ready: [];
|
|
226
|
+
/** @event Emitted when this shard resumes a connection. */
|
|
227
|
+
resume: [];
|
|
228
|
+
/** @event Emitted with various warning information. */
|
|
229
|
+
warn: [info: string];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
233
|
+
export interface VoiceEvents {}
|
|
@@ -37,7 +37,7 @@ import type CategoryChannel from "../structures/CategoryChannel";
|
|
|
37
37
|
import type AnnouncementChannel from "../structures/AnnouncementChannel";
|
|
38
38
|
import type StageChannel from "../structures/StageChannel";
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// channels, guild_scheduled_events, joined_at, large, member_count, members, presences,
|
|
41
41
|
// stage_instances, threads, unavailable, voice_states - all gateway only
|
|
42
42
|
export interface RawGuild {
|
|
43
43
|
afk_channel_id: string | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RawUser } from "./users";
|
|
2
2
|
import type { OAuthWebhook } from "./webhooks";
|
|
3
3
|
import type { RawIntegration } from "./guilds";
|
|
4
|
-
import type { ConnectionService,
|
|
4
|
+
import type { ConnectionService, PermissionName, TeamMembershipState, VisibilityTypes } from "../Constants";
|
|
5
5
|
import type PartialApplication from "../structures/PartialApplication";
|
|
6
6
|
import type User from "../structures/User";
|
|
7
7
|
import type Webhook from "../structures/Webhook";
|
|
@@ -50,7 +50,7 @@ export interface RawTeamMember {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export interface InstallParams {
|
|
53
|
-
permissions: Array<
|
|
53
|
+
permissions: Array<PermissionName>;
|
|
54
54
|
scopes: Array<string>;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -151,6 +151,9 @@ export interface RefreshTokenOptions {
|
|
|
151
151
|
refreshToken: string;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
export type RawRefreshTokenResponse = Omit<RawExchangeCodeResponse, "webhook">;
|
|
155
|
+
export type RefreshTokenResponse = Omit<ExchangeCodeResponse, "webhook">;
|
|
156
|
+
|
|
154
157
|
export interface ClientCredentialsTokenOptions {
|
|
155
158
|
/** The id of the client to perform the authorization with. This can be omitted if the global authorization is the proper (Basic base64(clientID:clientSecret)) already, or if connected to the gateway and ready. */
|
|
156
159
|
clientID?: string;
|
|
@@ -9,6 +9,7 @@ export interface RequestOptions {
|
|
|
9
9
|
auth?: boolean | string;
|
|
10
10
|
files?: Array<File>;
|
|
11
11
|
form?: FormData;
|
|
12
|
+
headers?: Record<string, string>;
|
|
12
13
|
json?: unknown;
|
|
13
14
|
method: RESTMethod;
|
|
14
15
|
path: string;
|
|
@@ -32,7 +33,7 @@ export interface RawRequest {
|
|
|
32
33
|
path: string;
|
|
33
34
|
/** the body sent with the request */
|
|
34
35
|
requestBody: string | FormData | undefined;
|
|
35
|
-
/** the body we
|
|
36
|
+
/** the body we received */
|
|
36
37
|
responseBody: Buffer | string | Record<string, unknown> | null;
|
|
37
38
|
/** the name of the route used in the request */
|
|
38
39
|
route: string;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export interface Uncached {
|
|
2
2
|
id: string;
|
|
3
3
|
}
|
|
4
|
+
|
|
5
|
+
type AllKeys<T> = T extends unknown ? keyof T : never;
|
|
6
|
+
type Id<T> = T extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
7
|
+
type _ExclusifyUnion<T, K extends PropertyKey> =
|
|
8
|
+
T extends unknown ? Id<T & Partial<Record<Exclude<K, keyof T>, never>>> : never;
|
|
9
|
+
type ExclusifyUnion<T> = _ExclusifyUnion<T, AllKeys<T>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** A {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} with some Array-like additions. */
|
|
2
2
|
export default class Collection<K, V> extends Map<K, V> {
|
|
3
|
+
/** If this collection is empty. */
|
|
3
4
|
get empty(): boolean;
|
|
4
5
|
/** See: {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every | Array#every } */
|
|
5
6
|
every<T extends V, ThisArg = Collection<K, V>>(predicate: (value: V, index: number, array: Array<V>) => value is T, thisArg?: ThisArg): this is Array<T>;
|
|
@@ -25,7 +26,7 @@ export default class Collection<K, V> extends Map<K, V> {
|
|
|
25
26
|
last(): V | undefined;
|
|
26
27
|
last(amount: number): Array<V>;
|
|
27
28
|
/** See: {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array#map } */
|
|
28
|
-
map<T>(predicate: (value: V, index: number, obj: Array<V>) => T, thisArg?: unknown): T
|
|
29
|
+
map<T>(predicate: (value: V, index: number, obj: Array<V>) => T, thisArg?: unknown): Array<T>;
|
|
29
30
|
/**
|
|
30
31
|
* Pick a random element from the collection, or undefined if the collection is empty.
|
|
31
32
|
*/
|
|
@@ -41,5 +42,5 @@ export default class Collection<K, V> extends Map<K, V> {
|
|
|
41
42
|
/** See: {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some | Array#some } */
|
|
42
43
|
some<ThisArg = Collection<K, V>>(predicate: (value: V, index: number, array: Array<V>) => unknown, thisArg?: ThisArg): boolean;
|
|
43
44
|
/** Get the values of this collection as an array. */
|
|
44
|
-
toArray(): V
|
|
45
|
+
toArray(): Array<V>;
|
|
45
46
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/** A {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} with some Array-like additions. */
|
|
4
4
|
class Collection extends Map {
|
|
5
|
+
/** If this collection is empty. */
|
|
5
6
|
get empty() {
|
|
6
7
|
return this.size === 0;
|
|
7
8
|
}
|
|
@@ -23,20 +24,24 @@ class Collection extends Map {
|
|
|
23
24
|
const iterable = this.values();
|
|
24
25
|
return iterable.next().value;
|
|
25
26
|
}
|
|
26
|
-
if (amount < 0)
|
|
27
|
+
if (amount < 0) {
|
|
27
28
|
return this.last(amount * -1);
|
|
29
|
+
}
|
|
28
30
|
amount = Math.min(amount, this.size);
|
|
29
31
|
const iterable = this.values();
|
|
30
32
|
return Array.from({ length: amount }, () => iterable.next().value);
|
|
31
33
|
}
|
|
32
34
|
last(amount) {
|
|
33
35
|
const iterator = Array.from(this.values());
|
|
34
|
-
if (typeof amount === "undefined")
|
|
36
|
+
if (typeof amount === "undefined") {
|
|
35
37
|
return iterator[iterator.length - 1];
|
|
36
|
-
|
|
38
|
+
}
|
|
39
|
+
if (amount < 0) {
|
|
37
40
|
return this.first(amount * -1);
|
|
38
|
-
|
|
41
|
+
}
|
|
42
|
+
if (!amount) {
|
|
39
43
|
return [];
|
|
44
|
+
}
|
|
40
45
|
return iterator.slice(-amount);
|
|
41
46
|
}
|
|
42
47
|
/** See: {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array#map } */
|
|
@@ -47,8 +52,9 @@ class Collection extends Map {
|
|
|
47
52
|
* Pick a random element from the collection, or undefined if the collection is empty.
|
|
48
53
|
*/
|
|
49
54
|
random() {
|
|
50
|
-
if (this.empty)
|
|
55
|
+
if (this.empty) {
|
|
51
56
|
return undefined;
|
|
57
|
+
}
|
|
52
58
|
const iterable = Array.from(this.values());
|
|
53
59
|
return iterable[Math.floor(Math.random() * iterable.length)];
|
|
54
60
|
}
|
|
@@ -68,4 +74,4 @@ class Collection extends Map {
|
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
exports.default = Collection;
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
77
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29sbGVjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi91dGlsL0NvbGxlY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwySUFBMkk7QUFDM0ksTUFBcUIsVUFBaUIsU0FBUSxHQUFTO0lBQ25ELG1DQUFtQztJQUNuQyxJQUFJLEtBQUs7UUFDTCxPQUFPLElBQUksQ0FBQyxJQUFJLEtBQUssQ0FBQyxDQ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E1BQU0sUUFBUSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7UUFFM0MsT0FBTyxRQUFRLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLEdBQUcsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7SUFDakUsQ0FBQztJQU1ELE1BQU0sQ0FBSSxTQUEwRixFQUFFLFlBQWdCO1FBQ2xILE9BQU8sSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDLE1BQU0sQ0FBQyxTQUFTLEVBQUUsWUFBYSxDQUFDLENBQUM7SUFDM0QsQ0FBQztJQU1ELFdBQVcsQ0FBSSxTQUEwRixFQUFFLFlBQWdCO1FBQ3ZILE9BQU8sSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDLFdBQVcsQ0FBQyxTQUFTLEVBQUUsWUFBYSxDQUFDLENBQUM7SUFDaEUsQ0FBQztJQUVELDZIQUE2SDtJQUM3SCxJQUFJLENBQTZCLFNBQWdFLEVBQUUsT0FBaUI7UUFDaEgsT0FBTyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxPQUFPLENBQUMsQ0FBQztJQUNuRCxDQUFDO0lBRUQscURBQXFEO0lBQ3JELE9BQU87UUFDSCxPQUFPLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7SUFDckMsQ0FBQztDQUNKO0FBdEhELDZCQXNIQyJ9
|
|
@@ -14,25 +14,32 @@ class InteractionOptionsWrapper {
|
|
|
14
14
|
_getOption(name, required = false, type) {
|
|
15
15
|
let baseOptions;
|
|
16
16
|
const sub = this.getSubCommand(false);
|
|
17
|
-
if (sub?.length === 1)
|
|
17
|
+
if (sub?.length === 1) {
|
|
18
18
|
baseOptions = this.raw.find(o => o.name === sub[0] && o.type === Constants_1.ApplicationCommandOptionTypes.SUB_COMMAND)?.options;
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
else if (sub?.length === 2) {
|
|
20
21
|
baseOptions = this.raw.find(o => o.name === sub[0] && o.type === Constants_1.ApplicationCommandOptionTypes.SUB_COMMAND_GROUP)?.options?.find(o2 => o2.name === sub[1] && o2.type === Constants_1.ApplicationCommandOptionTypes.SUB_COMMAND)?.options;
|
|
22
|
+
}
|
|
21
23
|
const opt = (baseOptions || this.raw).find(o => o.name === name && o.type === type);
|
|
22
|
-
if (!opt && required)
|
|
24
|
+
if (!opt && required) {
|
|
23
25
|
throw new Error(`Missing required option: ${name}`);
|
|
24
|
-
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
25
28
|
return opt;
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
getAttachment(name, required) {
|
|
28
|
-
if (this.resolved === null)
|
|
29
|
-
throw new Error("
|
|
32
|
+
if (this.resolved === null) {
|
|
33
|
+
throw new Error("Attempt to use getAttachmentValue with null resolved.");
|
|
34
|
+
}
|
|
30
35
|
let val;
|
|
31
|
-
if (!(val = this.getAttachmentOption(name, required)?.value))
|
|
36
|
+
if (!(val = this.getAttachmentOption(name, required)?.value)) {
|
|
32
37
|
return undefined;
|
|
38
|
+
}
|
|
33
39
|
const a = this.resolved.attachments.get(val);
|
|
34
|
-
if (!a && required)
|
|
35
|
-
throw new Error(`
|
|
40
|
+
if (!a && required) {
|
|
41
|
+
throw new Error(`Attachment not present for required option: ${name}`);
|
|
42
|
+
}
|
|
36
43
|
return a;
|
|
37
44
|
}
|
|
38
45
|
getAttachmentOption(name, required) {
|
|
@@ -45,14 +52,17 @@ class InteractionOptionsWrapper {
|
|
|
45
52
|
return this._getOption(name, required, Constants_1.ApplicationCommandOptionTypes.BOOLEAN);
|
|
46
53
|
}
|
|
47
54
|
getChannel(name, required) {
|
|
48
|
-
if (this.resolved === null)
|
|
49
|
-
throw new Error("
|
|
55
|
+
if (this.resolved === null) {
|
|
56
|
+
throw new Error("Attempt to use getChannelValue with null resolved.");
|
|
57
|
+
}
|
|
50
58
|
let val;
|
|
51
|
-
if (!(val = this.getChannelOption(name, required)?.value))
|
|
59
|
+
if (!(val = this.getChannelOption(name, required)?.value)) {
|
|
52
60
|
return undefined;
|
|
61
|
+
}
|
|
53
62
|
const ch = this.resolved.channels.get(val);
|
|
54
|
-
if (!ch && required)
|
|
55
|
-
throw new Error(`
|
|
63
|
+
if (!ch && required) {
|
|
64
|
+
throw new Error(`Channel not present for required option: ${name}`);
|
|
65
|
+
}
|
|
56
66
|
return ch;
|
|
57
67
|
}
|
|
58
68
|
getChannelOption(name, required) {
|
|
@@ -65,27 +75,33 @@ class InteractionOptionsWrapper {
|
|
|
65
75
|
return this._getOption(name, required, Constants_1.ApplicationCommandOptionTypes.INTEGER);
|
|
66
76
|
}
|
|
67
77
|
getMember(name, required) {
|
|
68
|
-
if (this.resolved === null)
|
|
69
|
-
throw new Error("
|
|
78
|
+
if (this.resolved === null) {
|
|
79
|
+
throw new Error("Attempt to use getMemberValue with null resolved.");
|
|
80
|
+
}
|
|
70
81
|
let val;
|
|
71
|
-
if (!(val = this.getUserOption(name, required)?.value))
|
|
82
|
+
if (!(val = this.getUserOption(name, required)?.value)) {
|
|
72
83
|
return undefined;
|
|
84
|
+
}
|
|
73
85
|
const ch = this.resolved.members.get(val);
|
|
74
|
-
if (!ch && required)
|
|
75
|
-
throw new Error(`
|
|
86
|
+
if (!ch && required) {
|
|
87
|
+
throw new Error(`Member not present for required option: ${name}`);
|
|
88
|
+
}
|
|
76
89
|
return ch;
|
|
77
90
|
}
|
|
78
91
|
getMentionable(name, required) {
|
|
79
|
-
if (this.resolved === null)
|
|
80
|
-
throw new Error("
|
|
92
|
+
if (this.resolved === null) {
|
|
93
|
+
throw new Error("Attempt to use getMentionableValue with null resolved.");
|
|
94
|
+
}
|
|
81
95
|
let val;
|
|
82
|
-
if (!(val = this._getOption(name, required, Constants_1.ApplicationCommandOptionTypes.MENTIONABLE)?.value))
|
|
96
|
+
if (!(val = this._getOption(name, required, Constants_1.ApplicationCommandOptionTypes.MENTIONABLE)?.value)) {
|
|
83
97
|
return undefined;
|
|
98
|
+
}
|
|
84
99
|
const ch = this.resolved.channels.get(val);
|
|
85
100
|
const role = this.resolved.roles.get(val);
|
|
86
101
|
const user = this.resolved.users.get(val);
|
|
87
|
-
if ((!ch && !role && !user) && required)
|
|
88
|
-
throw new Error(`
|
|
102
|
+
if ((!ch && !role && !user) && required) {
|
|
103
|
+
throw new Error(`Value not present for required option: ${name}`);
|
|
104
|
+
}
|
|
89
105
|
return ch;
|
|
90
106
|
}
|
|
91
107
|
getMentionableOption(name, required) {
|
|
@@ -98,14 +114,17 @@ class InteractionOptionsWrapper {
|
|
|
98
114
|
return this._getOption(name, required, Constants_1.ApplicationCommandOptionTypes.NUMBER);
|
|
99
115
|
}
|
|
100
116
|
getRole(name, required) {
|
|
101
|
-
if (this.resolved === null)
|
|
102
|
-
throw new Error("
|
|
117
|
+
if (this.resolved === null) {
|
|
118
|
+
throw new Error("Attempt to use getRoleValue with null resolved.");
|
|
119
|
+
}
|
|
103
120
|
let val;
|
|
104
|
-
if (!(val = this.getRoleOption(name, required)?.value))
|
|
121
|
+
if (!(val = this.getRoleOption(name, required)?.value)) {
|
|
105
122
|
return undefined;
|
|
123
|
+
}
|
|
106
124
|
const ch = this.resolved.roles.get(val);
|
|
107
|
-
if (!ch && required)
|
|
108
|
-
throw new Error(`
|
|
125
|
+
if (!ch && required) {
|
|
126
|
+
throw new Error(`Role not present for required option: ${name}`);
|
|
127
|
+
}
|
|
109
128
|
return ch;
|
|
110
129
|
}
|
|
111
130
|
getRoleOption(name, required) {
|
|
@@ -120,33 +139,41 @@ class InteractionOptionsWrapper {
|
|
|
120
139
|
getSubCommand(required) {
|
|
121
140
|
const opt = this.raw.find(o => o.type === Constants_1.ApplicationCommandOptionTypes.SUB_COMMAND || o.type === Constants_1.ApplicationCommandOptionTypes.SUB_COMMAND_GROUP);
|
|
122
141
|
if (!opt?.options) {
|
|
123
|
-
if (required)
|
|
124
|
-
throw new Error("Missing required option:
|
|
125
|
-
|
|
142
|
+
if (required) {
|
|
143
|
+
throw new Error("Missing required option: SubCommand/SubCommandGroup.");
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
126
146
|
return undefined;
|
|
147
|
+
}
|
|
127
148
|
}
|
|
128
149
|
else {
|
|
129
150
|
// nested
|
|
130
151
|
if (opt.options.length === 1 && opt.type === Constants_1.ApplicationCommandOptionTypes.SUB_COMMAND_GROUP) {
|
|
131
152
|
const sub = opt.options.find(o => o.type === Constants_1.ApplicationCommandOptionTypes.SUB_COMMAND);
|
|
132
|
-
if (!sub?.options)
|
|
153
|
+
if (!sub?.options) {
|
|
133
154
|
return [opt.name];
|
|
134
|
-
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
135
157
|
return [opt.name, sub.name];
|
|
158
|
+
}
|
|
136
159
|
}
|
|
137
|
-
else
|
|
160
|
+
else {
|
|
138
161
|
return [opt.name];
|
|
162
|
+
}
|
|
139
163
|
}
|
|
140
164
|
}
|
|
141
165
|
getUser(name, required) {
|
|
142
|
-
if (this.resolved === null)
|
|
143
|
-
throw new Error("
|
|
166
|
+
if (this.resolved === null) {
|
|
167
|
+
throw new Error("Attempt to use getUserValue with null resolved.");
|
|
168
|
+
}
|
|
144
169
|
let val;
|
|
145
|
-
if (!(val = this.getUserOption(name, required)?.value))
|
|
170
|
+
if (!(val = this.getUserOption(name, required)?.value)) {
|
|
146
171
|
return undefined;
|
|
172
|
+
}
|
|
147
173
|
const ch = this.resolved.users.get(val);
|
|
148
|
-
if (!ch && required)
|
|
149
|
-
throw new Error(`
|
|
174
|
+
if (!ch && required) {
|
|
175
|
+
throw new Error(`User not present for required option: ${name}`);
|
|
176
|
+
}
|
|
150
177
|
return ch;
|
|
151
178
|
}
|
|
152
179
|
getUserOption(name, required) {
|
|
@@ -154,4 +181,4 @@ class InteractionOptionsWrapper {
|
|
|
154
181
|
}
|
|
155
182
|
}
|
|
156
183
|
exports.default = InteractionOptionsWrapper;
|
|
157
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
184
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW50ZXJhY3Rpb25PcHRpb25zV3JhcHBlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi91dGlsL0ludGVyYWN0aW9uT3B0aW9uc1dyYXBwZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw0Q0FBNkQ7QUF1QjdELHlDQUF5QztBQUN6QyxNQUFxQix5QkFBeUI7SUFDMUMscUNBQXFDO0lBQ3JDLEdBQUcsQ0FBNEI7SUFDL0Isb0RBQW9EO0lBQ3BELFFBQVEsQ0FBbUQ7SUFDM0QsWUFBWSxJQUErQixFQUFFLFFBQTBEO1FBQ25HLElBQUksQ0FBQyxHQUFHLEdBQUcsSUFBSSxDQUFDO1FBQ2hCLElBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO0lBQzdCLENBQUM7SUFFTyxVQUFVLENBQXNFLElBQVksRUFBRSxRQUFRLEdBQUcsS0FBSyxFQUFFLElBQW1DO1FBQ3ZKLElBQUksV0FBMkQsQ0FBQztRQUNoRSxNQUFNLEdBQUcsR0FBRyxJQUFJLENBQUMsYUFBYSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3RDLElBQUksR0FBRyxFQUFFLE1BQU0sS0FBSyxDQUFDLEVBQUU7WUFDbkIsV0FBVyxHQUFJLElBQUksQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksS0FBSyxHQUFHLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLElBQUksS0FBSyx5Q0FBNkIsQ0FBQyxXQUFXLENBQThDLEVBQUU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sQ0FBQyxDQUFDO1NBQ3RFO1FBQ0QsSUFBSSxHQUF1QixDQUFDO1FBQzVCLElBQUksQ0FBQyxDQUFDLEdBQUcsR0FBRyxJQUFJLENBQUMsYUFBYSxDQUFDLElBQUksRUFBRSxRQUFpQixDQUFDLEVBQUUsS0FBSyxDQUFDLEVBQUU7WUFDN0QsT0FBTyxTQUFTLENBQUM7U0FDcEI7UUFDRCxNQUFNLEVBQUUsR0FBRyxJQUFJLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDeEMsSUFBSSxDQUFDLEVBQUUsSUFBSSxRQUFRLEVBQUU7WUFDakIsTUFBTSxJQUFJLEtBQUssQ0FBQyx5Q0FBeUMsSUFBSSxFQUFFLENBQUMsQ0FBQztTQUNwRTtRQUNELE9BQU8sRUFBRSxDQUFDO0lBQ2QsQ0FBQztJQVNELGFBQWEsQ0FBQyxJQUFZLEVBQUUsUUFBa0I7UUFDMUMsT0FBTyxJQUFJLENBQUMsVUFBVSxDQUFDLElBQUksRUFBRSxRQUFRLEVBQUUseUNBQTZCLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDL0UsQ0FBQztDQUNKO0FBOVVELDRDQThVQyJ9
|
|
@@ -104,3 +104,4 @@ export declare const INTERACTION_CALLBACK: (interactionID: string, interactionTo
|
|
|
104
104
|
export declare const GATEWAY: "/gateway";
|
|
105
105
|
export declare const GATEWAY_BOT: "/gateway/bot";
|
|
106
106
|
export declare const USER: (userID: string) => `/users/${string}`;
|
|
107
|
+
export declare const MESSAGE_LINK: (guildID: string, channelID: string, messageID: string) => `/channels/${string}/${string}/${string}`;
|