@zygout/eris 0.0.0-stage → 0.19.1
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/LICENSE +20 -0
- package/README.md +108 -2
- package/esm.mjs +72 -0
- package/index.d.ts +4407 -0
- package/index.js +75 -0
- package/lib/Client.js +4708 -0
- package/lib/Constants.d.ts +990 -0
- package/lib/Constants.js +1163 -0
- package/lib/command/Command.js +552 -0
- package/lib/command/CommandClient.js +460 -0
- package/lib/errors/DiscordHTTPError.js +63 -0
- package/lib/errors/DiscordRESTError.js +77 -0
- package/lib/gateway/Shard.js +3029 -0
- package/lib/gateway/ShardManager.js +164 -0
- package/lib/rest/Endpoints.js +172 -0
- package/lib/rest/RequestHandler.js +459 -0
- package/lib/structures/ApplicationCommand.js +125 -0
- package/lib/structures/AutoModerationRule.js +143 -0
- package/lib/structures/AutocompleteInteraction.js +80 -0
- package/lib/structures/Base.js +81 -0
- package/lib/structures/CategoryChannel.js +77 -0
- package/lib/structures/Channel.js +98 -0
- package/lib/structures/CommandInteraction.js +473 -0
- package/lib/structures/ComponentInteraction.js +538 -0
- package/lib/structures/DMChannel.js +278 -0
- package/lib/structures/Entitlement.js +77 -0
- package/lib/structures/ExtendedUser.js +46 -0
- package/lib/structures/ForumChannel.js +24 -0
- package/lib/structures/GroupChannel.js +106 -0
- package/lib/structures/Guild.js +1677 -0
- package/lib/structures/GuildAuditLogEntry.js +190 -0
- package/lib/structures/GuildChannel.js +128 -0
- package/lib/structures/GuildIntegration.js +99 -0
- package/lib/structures/GuildPreview.js +97 -0
- package/lib/structures/GuildScheduledEvent.js +176 -0
- package/lib/structures/GuildTemplate.js +76 -0
- package/lib/structures/GuildTextableChannel.js +260 -0
- package/lib/structures/Interaction.js +133 -0
- package/lib/structures/Invite.js +143 -0
- package/lib/structures/Lobby.js +108 -0
- package/lib/structures/LobbyMember.js +59 -0
- package/lib/structures/MediaChannel.js +216 -0
- package/lib/structures/Member.js +371 -0
- package/lib/structures/Message.js +708 -0
- package/lib/structures/ModalSubmitInteraction.js +478 -0
- package/lib/structures/NewsChannel.js +34 -0
- package/lib/structures/NewsThreadChannel.js +12 -0
- package/lib/structures/Permission.js +80 -0
- package/lib/structures/PermissionOverwrite.js +32 -0
- package/lib/structures/PingInteraction.js +39 -0
- package/lib/structures/PrivateThreadChannel.js +25 -0
- package/lib/structures/PublicThreadChannel.js +26 -0
- package/lib/structures/Role.js +163 -0
- package/lib/structures/SKU.js +80 -0
- package/lib/structures/SoundboardSound.js +79 -0
- package/lib/structures/StageChannel.js +59 -0
- package/lib/structures/StageInstance.js +55 -0
- package/lib/structures/Subscription.js +69 -0
- package/lib/structures/TextChannel.js +202 -0
- package/lib/structures/ThreadChannel.js +143 -0
- package/lib/structures/ThreadMember.js +59 -0
- package/lib/structures/UnavailableGuild.js +26 -0
- package/lib/structures/UnknownInteraction.js +502 -0
- package/lib/structures/User.js +296 -0
- package/lib/structures/VoiceChannel.js +166 -0
- package/lib/structures/VoiceState.js +84 -0
- package/lib/util/BrowserWebSocket.js +76 -0
- package/lib/util/Bucket.js +89 -0
- package/lib/util/Collection.js +202 -0
- package/lib/util/MultipartData.js +70 -0
- package/lib/util/Opus.js +33 -0
- package/lib/util/SequentialBucket.js +83 -0
- package/lib/util/emitDeprecation.js +26 -0
- package/lib/voice/Piper.js +300 -0
- package/lib/voice/SharedStream.js +238 -0
- package/lib/voice/VoiceConnection.js +1440 -0
- package/lib/voice/VoiceConnectionManager.js +151 -0
- package/lib/voice/VoiceDataStream.js +22 -0
- package/lib/voice/streams/BaseTransformer.js +40 -0
- package/lib/voice/streams/DCAOpusTransformer.js +78 -0
- package/lib/voice/streams/FFmpegDuplex.js +192 -0
- package/lib/voice/streams/FFmpegOggTransformer.js +35 -0
- package/lib/voice/streams/FFmpegPCMTransformer.js +26 -0
- package/lib/voice/streams/OggOpusTransformer.js +108 -0
- package/lib/voice/streams/PCMOpusTransformer.js +61 -0
- package/lib/voice/streams/VolumeTransformer.js +50 -0
- package/lib/voice/streams/WebmOpusTransformer.js +258 -0
- package/package.json +81 -4
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("../structures/Base");
|
|
4
|
+
const Collection = require("../util/Collection");
|
|
5
|
+
const Shard = require("./Shard");
|
|
6
|
+
|
|
7
|
+
class ShardManager extends Collection {
|
|
8
|
+
constructor(client, options = {}) {
|
|
9
|
+
super(Shard);
|
|
10
|
+
this._client = client;
|
|
11
|
+
|
|
12
|
+
this.options = Object.assign({
|
|
13
|
+
concurrency: 1,
|
|
14
|
+
}, options);
|
|
15
|
+
|
|
16
|
+
this.buckets = new Map();
|
|
17
|
+
this.connectQueue = [];
|
|
18
|
+
this.connectTimeout = null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
connect(shard) {
|
|
22
|
+
this.connectQueue.push(shard);
|
|
23
|
+
this.tryConnect();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
setConcurrency(concurrency) {
|
|
27
|
+
this.options.concurrency = concurrency;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
spawn(id) {
|
|
31
|
+
let shard = this.get(id);
|
|
32
|
+
if (!shard) {
|
|
33
|
+
shard = this.add(new Shard(id, this._client));
|
|
34
|
+
shard.on("ready", () => {
|
|
35
|
+
/**
|
|
36
|
+
* Fired when a shard turns ready
|
|
37
|
+
* @event Client#shardReady
|
|
38
|
+
* @prop {Number} id The ID of the shard
|
|
39
|
+
*/
|
|
40
|
+
this._client.emit("shardReady", shard.id);
|
|
41
|
+
if (this._client.ready) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
for (const other of this.values()) {
|
|
45
|
+
if (!other.ready) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
this._client.ready = true;
|
|
50
|
+
this._client.startTime = Date.now();
|
|
51
|
+
/**
|
|
52
|
+
* Fired when all shards turn ready
|
|
53
|
+
* @event Client#ready
|
|
54
|
+
*/
|
|
55
|
+
this._client.emit("ready");
|
|
56
|
+
}).on("resume", () => {
|
|
57
|
+
/**
|
|
58
|
+
* Fired when a shard resumes
|
|
59
|
+
* @event Client#shardResume
|
|
60
|
+
* @prop {Number} id The ID of the shard
|
|
61
|
+
*/
|
|
62
|
+
this._client.emit("shardResume", shard.id);
|
|
63
|
+
if (this._client.ready) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
for (const other of this.values()) {
|
|
67
|
+
if (!other.ready) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
this._client.ready = true;
|
|
72
|
+
this._client.startTime = Date.now();
|
|
73
|
+
this._client.emit("ready");
|
|
74
|
+
}).on("disconnect", (error) => {
|
|
75
|
+
/**
|
|
76
|
+
* Fired when a shard disconnects
|
|
77
|
+
* @event Client#shardDisconnect
|
|
78
|
+
* @prop {Error?} error The error, if any
|
|
79
|
+
* @prop {Number} id The ID of the shard
|
|
80
|
+
*/
|
|
81
|
+
this._client.emit("shardDisconnect", error, shard.id);
|
|
82
|
+
for (const other of this.values()) {
|
|
83
|
+
if (other.ready) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
this._client.ready = false;
|
|
88
|
+
this._client.startTime = 0;
|
|
89
|
+
/**
|
|
90
|
+
* Fired when all shards disconnect
|
|
91
|
+
* @event Client#disconnect
|
|
92
|
+
*/
|
|
93
|
+
this._client.emit("disconnect");
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
if (shard.status === "disconnected") {
|
|
97
|
+
return this.connect(shard);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
tryConnect() {
|
|
102
|
+
// nothing in queue
|
|
103
|
+
if (this.connectQueue.length === 0) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// loop over the connectQueue
|
|
108
|
+
for (const shard of this.connectQueue) {
|
|
109
|
+
// find the bucket for our shard
|
|
110
|
+
const rateLimitKey = (shard.id % this.options.concurrency) || 0;
|
|
111
|
+
const lastConnect = this.buckets.get(rateLimitKey) || 0;
|
|
112
|
+
|
|
113
|
+
// has enough time passed since the last connect for this bucket (5s/bucket)?
|
|
114
|
+
// alternatively if we have a sessionID, we can skip this check
|
|
115
|
+
if (!shard.sessionID && Date.now() - lastConnect < 5000) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Are there any connecting shards in the same bucket we should wait on?
|
|
120
|
+
if (this.some((s) => s.connecting && ((s.id % this.options.concurrency) || 0) === rateLimitKey)) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// connect the shard
|
|
125
|
+
shard.connect();
|
|
126
|
+
this.buckets.set(rateLimitKey, Date.now());
|
|
127
|
+
|
|
128
|
+
// remove the shard from the queue
|
|
129
|
+
const index = this.connectQueue.findIndex((s) => s.id === shard.id);
|
|
130
|
+
this.connectQueue.splice(index, 1);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// set the next timeout if we have more shards to connect
|
|
134
|
+
if (!this.connectTimeout && this.connectQueue.length > 0) {
|
|
135
|
+
this.connectTimeout = setTimeout(() => {
|
|
136
|
+
this.connectTimeout = null;
|
|
137
|
+
this.tryConnect();
|
|
138
|
+
}, 500);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_readyPacketCB(shardID) {
|
|
143
|
+
const rateLimitKey = (shardID % this.options.concurrency) || 0;
|
|
144
|
+
this.buckets.set(rateLimitKey, Date.now());
|
|
145
|
+
|
|
146
|
+
this.tryConnect();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
toString() {
|
|
150
|
+
return `[ShardManager ${this.size}]`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
toJSON(props = []) {
|
|
154
|
+
return Base.prototype.toJSON.call(this, [
|
|
155
|
+
"buckets",
|
|
156
|
+
"connectQueue",
|
|
157
|
+
"connectTimeout",
|
|
158
|
+
"options",
|
|
159
|
+
...props,
|
|
160
|
+
]);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
module.exports = ShardManager;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { REST_VERSION } = require("../Constants");
|
|
4
|
+
|
|
5
|
+
module.exports.BASE_URL = "/api/v" + REST_VERSION;
|
|
6
|
+
module.exports.CDN_URL = "https://cdn.discordapp.com";
|
|
7
|
+
module.exports.CLIENT_URL = "https://discord.com";
|
|
8
|
+
|
|
9
|
+
module.exports.APPLICATION = (appID) => `/applications/${appID}`;
|
|
10
|
+
module.exports.APPLICATION_ACTIVITY_INSTANCE = (appID, instanceID) => `/applications/${appID}/activity-instances/${instanceID}`;
|
|
11
|
+
module.exports.APPLICATION_IDENTITIES = (appID, providerType, providerUserID) => `/applications/${appID}/application-identities/${providerType}/${providerUserID}`;
|
|
12
|
+
module.exports.APPLICATION_IDENTITY_PROFILE = (appID, userID, providerUserID) => `/applications/${appID}/users/${userID}/identities/${providerUserID}/profile`;
|
|
13
|
+
module.exports.APPLICATION_SKUS = (appID) => `/applications/${appID}/skus`;
|
|
14
|
+
module.exports.AUTO_MODERATION_RULE = (guildID, ruleID) => `/guilds/${guildID}/auto-moderation/rules/${ruleID}`;
|
|
15
|
+
module.exports.AUTO_MODERATION_RULES = (guildID) => `/guilds/${guildID}/auto-moderation/rules`;
|
|
16
|
+
module.exports.APPLICATION_EMOJIS = (applicationID) => `/applications/${applicationID}/emojis`;
|
|
17
|
+
module.exports.APPLICATION_EMOJI = (applicationID, emojiID) => `/applications/${applicationID}/emojis/${emojiID}`;
|
|
18
|
+
module.exports.CHANNEL_PERMISSIONS_MEMBER = (chanID, userID) => `/channels/${chanID}/permissions/member/${userID}`;
|
|
19
|
+
module.exports.CHANNEL_PERMISSIONS_ROLE = (chanID, roleID) => `/channels/${chanID}/permissions/role/${roleID}`;
|
|
20
|
+
module.exports.COMMAND = (applicationID, commandID) => `/applications/${applicationID}/commands/${commandID}`;
|
|
21
|
+
module.exports.COMMAND_PERMISSIONS = (applicationID, guildID, commandID) => `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}/permissions`;
|
|
22
|
+
module.exports.COMMANDS = (applicationID) => `/applications/${applicationID}/commands`;
|
|
23
|
+
module.exports.CHANNEL = (chanID) => `/channels/${chanID}`;
|
|
24
|
+
module.exports.CHANNEL_BULK_DELETE = (chanID) => `/channels/${chanID}/messages/bulk-delete`;
|
|
25
|
+
module.exports.CHANNEL_CROSSPOST = (chanID, msgID) => `/channels/${chanID}/messages/${msgID}/crosspost`;
|
|
26
|
+
module.exports.CHANNEL_FOLLOW = (chanID) => `/channels/${chanID}/followers`;
|
|
27
|
+
module.exports.CHANNEL_INVITES = (chanID) => `/channels/${chanID}/invites`;
|
|
28
|
+
module.exports.CHANNEL_MESSAGE_REACTION = (chanID, msgID, reaction) => `/channels/${chanID}/messages/${msgID}/reactions/${reaction}`;
|
|
29
|
+
module.exports.CHANNEL_MESSAGE_REACTION_USER = (chanID, msgID, reaction, userID) => `/channels/${chanID}/messages/${msgID}/reactions/${reaction}/${userID}`;
|
|
30
|
+
module.exports.CHANNEL_MESSAGE_REACTIONS = (chanID, msgID) => `/channels/${chanID}/messages/${msgID}/reactions`;
|
|
31
|
+
module.exports.CHANNEL_MESSAGE = (chanID, msgID) => `/channels/${chanID}/messages/${msgID}`;
|
|
32
|
+
module.exports.CHANNEL_MESSAGES = (chanID) => `/channels/${chanID}/messages`;
|
|
33
|
+
module.exports.CHANNEL_PERMISSION = (chanID, overID) => `/channels/${chanID}/permissions/${overID}`;
|
|
34
|
+
module.exports.CHANNEL_PERMISSIONS = (chanID) => `/channels/${chanID}/permissions`;
|
|
35
|
+
module.exports.CHANNEL_PIN = (chanID, msgID) => `/channels/${chanID}/messages/pins/${msgID}`;
|
|
36
|
+
module.exports.CHANNEL_PINS = (chanID) => `/channels/${chanID}/messages/pins`;
|
|
37
|
+
module.exports.CHANNEL_RECIPIENT = (groupID, userID) => `/channels/${groupID}/recipients/${userID}`;
|
|
38
|
+
module.exports.CHANNEL_TYPING = (chanID) => `/channels/${chanID}/typing`;
|
|
39
|
+
module.exports.CHANNEL_VOICE_STATUS = (chanID) => `/channels/${chanID}/voice-status`;
|
|
40
|
+
module.exports.CHANNEL_WEBHOOKS = (chanID) => `/channels/${chanID}/webhooks`;
|
|
41
|
+
module.exports.CHANNELS = "/channels";
|
|
42
|
+
module.exports.CUSTOM_EMOJI_GUILD = (emojiID) => `/emojis/${emojiID}/guild`;
|
|
43
|
+
module.exports.DISCOVERY_CATEGORIES = "/discovery/categories";
|
|
44
|
+
module.exports.DISCOVERY_VALIDATION = "/discovery/valid-term";
|
|
45
|
+
module.exports.ENTITLEMENT = (appID, entitlementID) => `/applications/${appID}/entitlements/${entitlementID}`;
|
|
46
|
+
module.exports.ENTITLEMENTS = (appID) => `/applications/${appID}/entitlements`;
|
|
47
|
+
module.exports.ENTITLEMENT_CONSUME = (appID, entitlementID) => `/applications/${appID}/entitlements/${entitlementID}/consume`;
|
|
48
|
+
module.exports.GATEWAY = "/gateway";
|
|
49
|
+
module.exports.GATEWAY_BOT = "/gateway/bot";
|
|
50
|
+
module.exports.GUILD = (guildID) => `/guilds/${guildID}`;
|
|
51
|
+
module.exports.GUILD_AUDIT_LOGS = (guildID) => `/guilds/${guildID}/audit-logs`;
|
|
52
|
+
module.exports.GUILD_BAN = (guildID, memberID) => `/guilds/${guildID}/bans/${memberID}`;
|
|
53
|
+
module.exports.GUILD_BANS = (guildID) => `/guilds/${guildID}/bans`;
|
|
54
|
+
module.exports.GUILD_BULK_BAN = (guildID) => `/guilds/${guildID}/bulk-ban`;
|
|
55
|
+
module.exports.GUILD_CHANNELS = (guildID) => `/guilds/${guildID}/channels`;
|
|
56
|
+
module.exports.GUILD_COMMAND = (applicationID, guildID, commandID) => `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}`;
|
|
57
|
+
module.exports.GUILD_COMMAND_PERMISSIONS = (applicationID, guildID) => `/applications/${applicationID}/guilds/${guildID}/commands/permissions`;
|
|
58
|
+
module.exports.GUILD_COMMANDS = (applicationID, guildID) => `/applications/${applicationID}/guilds/${guildID}/commands`;
|
|
59
|
+
module.exports.GUILD_DISCOVERY = (guildID) => `/guilds/${guildID}/discovery-metadata`;
|
|
60
|
+
module.exports.GUILD_DISCOVERY_CATEGORY = (guildID, categoryID) => `/guilds/${guildID}/discovery-categories/${categoryID}`;
|
|
61
|
+
module.exports.GUILD_EMOJI = (guildID, emojiID) => `/guilds/${guildID}/emojis/${emojiID}`;
|
|
62
|
+
module.exports.GUILD_EMOJIS = (guildID) => `/guilds/${guildID}/emojis`;
|
|
63
|
+
module.exports.GUILD_INCIDENT_ACTIONS = (guildID) => `/guilds/${guildID}/incident-actions`;
|
|
64
|
+
module.exports.GUILD_INTEGRATION = (guildID, inteID) => `/guilds/${guildID}/integrations/${inteID}`;
|
|
65
|
+
module.exports.GUILD_INTEGRATION_SYNC = (guildID, inteID) => `/guilds/${guildID}/integrations/${inteID}/sync`;
|
|
66
|
+
module.exports.GUILD_INTEGRATIONS = (guildID) => `/guilds/${guildID}/integrations`;
|
|
67
|
+
module.exports.GUILD_INVITES = (guildID) => `/guilds/${guildID}/invites`;
|
|
68
|
+
module.exports.GUILD_MEMBER = (guildID, memberID) => `/guilds/${guildID}/members/${memberID}`;
|
|
69
|
+
module.exports.GUILD_MEMBER_NICK = (guildID, memberID) => `/guilds/${guildID}/members/${memberID}/nick`;
|
|
70
|
+
module.exports.GUILD_MEMBER_ROLE = (guildID, memberID, roleID) => `/guilds/${guildID}/members/${memberID}/roles/${roleID}`;
|
|
71
|
+
module.exports.GUILD_MEMBERS = (guildID) => `/guilds/${guildID}/members`;
|
|
72
|
+
module.exports.GUILD_MEMBERS_SEARCH = (guildID) => `/guilds/${guildID}/members/search`;
|
|
73
|
+
module.exports.GUILD_MESSAGES_SEARCH = (guildID) => `/guilds/${guildID}/messages/search`;
|
|
74
|
+
module.exports.GUILD_ONBOARDING = (guildID) => `/guilds/${guildID}/onboarding`;
|
|
75
|
+
module.exports.GUILD_PERMISSIONS_MEMBER = (guildID, userID) => `/guilds/${guildID}/permissions/member/${userID}`;
|
|
76
|
+
module.exports.GUILD_PERMISSIONS_ROLE = (guildID, roleID) => `/guilds/${guildID}/permissions/role/${roleID}`;
|
|
77
|
+
module.exports.GUILD_PREVIEW = (guildID) => `/guilds/${guildID}/preview`;
|
|
78
|
+
module.exports.GUILD_PRUNE = (guildID) => `/guilds/${guildID}/prune`;
|
|
79
|
+
module.exports.GUILD_ROLE = (guildID, roleID) => `/guilds/${guildID}/roles/${roleID}`;
|
|
80
|
+
module.exports.GUILD_ROLE_MEMBER_COUNTS = (guildID) => `/guilds/${guildID}/roles/member-counts`;
|
|
81
|
+
module.exports.GUILD_ROLES = (guildID) => `/guilds/${guildID}/roles`;
|
|
82
|
+
module.exports.GUILD_SCHEDULED_EVENT = (guildID, scheduledEventID) => `/guilds/${guildID}/scheduled-events/${scheduledEventID}`;
|
|
83
|
+
module.exports.GUILD_SCHEDULED_EVENT_USERS = (guildID, scheduledEventID) => `/guilds/${guildID}/scheduled-events/${scheduledEventID}/users`;
|
|
84
|
+
module.exports.GUILD_SCHEDULED_EVENTS = (guildID) => `/guilds/${guildID}/scheduled-events`;
|
|
85
|
+
module.exports.GUILD_STICKER = (guildID, stickerID) => `/guilds/${guildID}/stickers/${stickerID}`;
|
|
86
|
+
module.exports.GUILD_STICKERS = (guildID) => `/guilds/${guildID}/stickers`;
|
|
87
|
+
module.exports.GUILD_TEMPLATE = (code) => `/guilds/templates/${code}`;
|
|
88
|
+
module.exports.GUILD_TEMPLATE_GUILD = (guildID, code) => `/guilds/${guildID}/templates/${code}`;
|
|
89
|
+
module.exports.GUILD_TEMPLATES = (guildID) => `/guilds/${guildID}/templates`;
|
|
90
|
+
module.exports.GUILD_VANITY_URL = (guildID) => `/guilds/${guildID}/vanity-url`;
|
|
91
|
+
module.exports.GUILD_VOICE_REGIONS = (guildID) => `/guilds/${guildID}/regions`;
|
|
92
|
+
module.exports.GUILD_WEBHOOKS = (guildID) => `/guilds/${guildID}/webhooks`;
|
|
93
|
+
module.exports.GUILD_WELCOME_SCREEN = (guildID) => `/guilds/${guildID}/welcome-screen`;
|
|
94
|
+
module.exports.GUILD_WIDGET = (guildID) => `/guilds/${guildID}/widget.json`;
|
|
95
|
+
module.exports.GUILD_WIDGET_IMAGE = (guildID) => `/guilds/${guildID}/widget.png`;
|
|
96
|
+
module.exports.GUILD_WIDGET_SETTINGS = (guildID) => `/guilds/${guildID}/widget`;
|
|
97
|
+
module.exports.GUILD_VOICE_STATE = (guildID, user) => `/guilds/${guildID}/voice-states/${user}`;
|
|
98
|
+
module.exports.INTERACTION_RESPOND = (interactID, interactToken) => `/interactions/${interactID}/${interactToken}/callback`;
|
|
99
|
+
module.exports.INVITE = (inviteID) => `/invites/${inviteID}`;
|
|
100
|
+
module.exports.INVITE_TARGET_USER = (inviteID, userID) => `/invites/${inviteID}/target-users/${userID}`;
|
|
101
|
+
module.exports.INVITE_TARGET_USERS = (inviteID) => `/invites/${inviteID}/target-users`;
|
|
102
|
+
module.exports.INVITE_TARGET_USERS_BULK_ADD = (inviteID) => `/invites/${inviteID}/target-users/bulk-add`;
|
|
103
|
+
module.exports.INVITE_TARGET_USERS_BULK_DELETE = (inviteID) => `/invites/${inviteID}/target-users/bulk-delete`;
|
|
104
|
+
module.exports.INVITE_TARGET_USERS_JOB_STATUS = (inviteID) => `/invites/${inviteID}/target-users/job-status`;
|
|
105
|
+
module.exports.LOBBIES = "/lobbies";
|
|
106
|
+
module.exports.LOBBY = (lobbyID) => `/lobbies/${lobbyID}`;
|
|
107
|
+
module.exports.LOBBY_MEMBER = (lobbyID, userID) => `/lobbies/${lobbyID}/members/${userID}`;
|
|
108
|
+
module.exports.LOBBY_MEMBER_INVITES = (lobbyID, userID) => `/lobbies/${lobbyID}/members/${userID}/invites`;
|
|
109
|
+
module.exports.LOBBY_MEMBERS_BULK = (lobbyID) => `/lobbies/${lobbyID}/members/bulk`;
|
|
110
|
+
module.exports.LOBBY_MESSAGE_MODERATION_METADATA = (lobbyID, msgID) => `/lobbies/${lobbyID}/messages/${msgID}/moderation-metadata`;
|
|
111
|
+
module.exports.OAUTH2_APPLICATION = "/oauth2/applications/@me";
|
|
112
|
+
module.exports.ORIGINAL_INTERACTION_RESPONSE = (appID, interactToken) => `/webhooks/${appID}/${interactToken}`;
|
|
113
|
+
module.exports.POLL_ANSWER_VOTERS = (channelID, msgID, answerID) => `/channels/${channelID}/polls/${msgID}/answers/${answerID}`;
|
|
114
|
+
module.exports.POLL_END = (channelID, msgID) => `/channels/${channelID}/polls/${msgID}/expire`;
|
|
115
|
+
module.exports.ROLE_CONNECTION_METADATA_RECORDS = (appID) => `/applications/${appID}/role-connections/metadata`;
|
|
116
|
+
module.exports.SKU_SUBSCRIPTION = (skuID, subscriptionID) => `/skus/${skuID}/subscriptions/${subscriptionID}`;
|
|
117
|
+
module.exports.SKU_SUBSCRIPTIONS = (skuID) => `/skus/${skuID}/subscriptions`;
|
|
118
|
+
module.exports.SOUNDBOARD_SOUND_GUILD = (guildID, soundID) => `/guilds/${guildID}/soundboard-sounds/${soundID}`;
|
|
119
|
+
module.exports.SOUNDBOARD_SOUNDS_DEFAULT = "/soundboard-default-sounds";
|
|
120
|
+
module.exports.SOUNDBOARD_SOUNDS_GUILD = (guildID) => `/guilds/${guildID}/soundboard-sounds`;
|
|
121
|
+
module.exports.SOUNDBOARD_SOUNDS_SEND = (channelID) => `/channels/${channelID}/send-soundboard-sound`;
|
|
122
|
+
module.exports.STAGE_INSTANCE = (channelID) => `/stage-instances/${channelID}`;
|
|
123
|
+
module.exports.STAGE_INSTANCES = "/stage-instances";
|
|
124
|
+
module.exports.STICKER = (stickerID) => `/stickers/${stickerID}`;
|
|
125
|
+
module.exports.STICKER_PACK = (packID) => `/sticker-packs/${packID}`;
|
|
126
|
+
module.exports.STICKER_PACKS = "/sticker-packs";
|
|
127
|
+
module.exports.THREAD_MEMBER = (channelID, userID) => `/channels/${channelID}/thread-members/${userID}`;
|
|
128
|
+
module.exports.THREAD_MEMBERS = (channelID) => `/channels/${channelID}/thread-members`;
|
|
129
|
+
module.exports.THREAD_WITH_MESSAGE = (channelID, msgID) => `/channels/${channelID}/messages/${msgID}/threads`;
|
|
130
|
+
module.exports.THREAD_WITHOUT_MESSAGE = (channelID) => `/channels/${channelID}/threads`;
|
|
131
|
+
module.exports.THREADS_ARCHIVED = (channelID, type) => `/channels/${channelID}/threads/archived/${type}`;
|
|
132
|
+
module.exports.THREADS_ARCHIVED_JOINED = (channelID) => `/channels/${channelID}/users/@me/threads/archived/private`;
|
|
133
|
+
module.exports.THREADS_GUILD_ACTIVE = (guildID) => `/guilds/${guildID}/threads/active`;
|
|
134
|
+
module.exports.USER = (userID) => `/users/${userID}`;
|
|
135
|
+
module.exports.USER_APPLICATION_IDENTITIES = (userID, appID) => `/users/${userID}/application-identities/${appID}`;
|
|
136
|
+
module.exports.USER_APPLICATION_IDENTITY_DELETE = (userID, appID, providerType, providerUserID) => `/users/${userID}/application-identities/${appID}/${providerType}/${providerUserID}/delete`;
|
|
137
|
+
module.exports.USER_CHANNELS = (userID) => `/users/${userID}/channels`;
|
|
138
|
+
module.exports.USER_GUILD = (userID, guildID) => `/users/${userID}/guilds/${guildID}`;
|
|
139
|
+
module.exports.USER_GUILDS = (userID) => `/users/${userID}/guilds`;
|
|
140
|
+
module.exports.VOICE_REGIONS = "/voice/regions";
|
|
141
|
+
module.exports.WEBHOOK = (hookID) => `/webhooks/${hookID}`;
|
|
142
|
+
module.exports.WEBHOOK_MESSAGE = (hookID, token, msgID) => `/webhooks/${hookID}/${token}/messages/${msgID}`;
|
|
143
|
+
module.exports.WEBHOOK_SLACK = (hookID) => `/webhooks/${hookID}/slack`;
|
|
144
|
+
module.exports.WEBHOOK_TOKEN = (hookID, token) => `/webhooks/${hookID}/${token}`;
|
|
145
|
+
module.exports.WEBHOOK_TOKEN_GITHUB = (hookID, token) => `/webhooks/${hookID}/${token}/github`;
|
|
146
|
+
module.exports.WEBHOOK_TOKEN_SLACK = (hookID, token) => `/webhooks/${hookID}/${token}/slack`;
|
|
147
|
+
|
|
148
|
+
// CDN Endpoints
|
|
149
|
+
module.exports.ACHIEVEMENT_ICON = (applicationID, achievementID, icon) => `/app-assets/${applicationID}/achievements/${achievementID}/icons/${icon}`;
|
|
150
|
+
module.exports.APPLICATION_ASSET = (applicationID, asset) => `/app-assets/${applicationID}/${asset}`;
|
|
151
|
+
module.exports.APPLICATION_COVER = (applicationID, cover) => `/app-icons/${applicationID}/${cover}`;
|
|
152
|
+
module.exports.APPLICATION_ICON = (applicationID, icon) => `/app-icons/${applicationID}/${icon}`;
|
|
153
|
+
module.exports.BANNER = (guildOrUserID, hash) => `/banners/${guildOrUserID}/${hash}`;
|
|
154
|
+
module.exports.CHANNEL_ICON = (chanID, chanIcon) => `/channel-icons/${chanID}/${chanIcon}`;
|
|
155
|
+
module.exports.CUSTOM_EMOJI = (emojiID) => `/emojis/${emojiID}`;
|
|
156
|
+
module.exports.DEFAULT_USER_AVATAR = (userDiscriminator) => `/embed/avatars/${userDiscriminator}`;
|
|
157
|
+
module.exports.GUILD_AVATAR = (guildID, userID, guildAvatar) => `/guilds/${guildID}/users/${userID}/avatars/${guildAvatar}`;
|
|
158
|
+
module.exports.GUILD_DISCOVERY_SPLASH = (guildID, guildDiscoverySplash) => `/discovery-splashes/${guildID}/${guildDiscoverySplash}`;
|
|
159
|
+
module.exports.GUILD_ICON = (guildID, guildIcon) => `/icons/${guildID}/${guildIcon}`;
|
|
160
|
+
module.exports.GUILD_MEMBER_BANNER = (guildID, userID, memberBanner) => `/guilds/${guildID}/users/${userID}/banners/${memberBanner}`;
|
|
161
|
+
module.exports.GUILD_SCHEDULED_EVENT_COVER = (eventID, eventIcon) => `/guild-events/${eventID}/${eventIcon}`;
|
|
162
|
+
module.exports.GUILD_SPLASH = (guildID, guildSplash) => `/splashes/${guildID}/${guildSplash}`;
|
|
163
|
+
module.exports.GUILD_TAG_BADGE = (guildID, badge) => `/guild-tag-badges/${guildID}/${badge}`;
|
|
164
|
+
module.exports.ROLE_ICON = (roleID, roleIcon) => `/role-icons/${roleID}/${roleIcon}`;
|
|
165
|
+
module.exports.SOUNDBOARD_SOUNDS = (soundID) => `soundboard-sounds/${soundID}`;
|
|
166
|
+
module.exports.TEAM_ICON = (teamID, teamIcon) => `/team-icons/${teamID}/${teamIcon}`;
|
|
167
|
+
module.exports.USER_AVATAR = (userID, userAvatar) => `/avatars/${userID}/${userAvatar}`;
|
|
168
|
+
module.exports.USER_AVATAR_DECORATION = (userDecoration) => `/avatar-decoration-presets/${userDecoration}`;
|
|
169
|
+
module.exports.USER_NAMEPLATE = (asset, file) => `/assets/collectibles/${asset}${file}`;
|
|
170
|
+
|
|
171
|
+
// Client Endpoints
|
|
172
|
+
module.exports.MESSAGE_LINK = (guildID, channelID, messageID) => `/channels/${guildID}/${channelID}/${messageID}`;
|