seyfert 2.1.0 → 2.1.1-dev-11316886063.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/Router.d.ts +2 -2
- package/lib/api/Router.js +2 -1
- package/lib/api/Routes/applications.d.ts +29 -30
- package/lib/api/Routes/cdn.d.ts +6 -1
- package/lib/api/Routes/channels.d.ts +44 -45
- package/lib/api/Routes/gateway.d.ts +3 -4
- package/lib/api/Routes/guilds.d.ts +81 -80
- package/lib/api/Routes/index.d.ts +3 -1
- package/lib/api/Routes/interactions.d.ts +6 -6
- package/lib/api/Routes/invites.d.ts +3 -4
- package/lib/api/Routes/skus.d.ts +4 -5
- package/lib/api/Routes/soundboard.d.ts +23 -0
- package/lib/api/Routes/soundboard.js +2 -0
- package/lib/api/Routes/stage-instances.d.ts +5 -6
- package/lib/api/Routes/stickers.d.ts +3 -4
- package/lib/api/Routes/users.d.ts +11 -12
- package/lib/api/Routes/voice.d.ts +2 -3
- package/lib/api/Routes/webhooks.d.ts +16 -15
- package/lib/api/api.d.ts +17 -11
- package/lib/api/api.js +12 -10
- package/lib/api/shared.d.ts +1 -1
- package/lib/api/utils/constants.d.ts +2 -0
- package/lib/api/utils/constants.js +2 -1
- package/lib/builders/ActionRow.d.ts +1 -1
- package/lib/builders/Attachment.d.ts +2 -2
- package/lib/builders/Attachment.js +1 -1
- package/lib/builders/Button.d.ts +1 -1
- package/lib/builders/Button.js +1 -1
- package/lib/builders/Embed.d.ts +1 -1
- package/lib/builders/Embed.js +2 -2
- package/lib/builders/Modal.d.ts +1 -1
- package/lib/builders/Poll.d.ts +1 -1
- package/lib/builders/Poll.js +1 -1
- package/lib/builders/SelectMenu.d.ts +1 -1
- package/lib/builders/SelectMenu.js +1 -1
- package/lib/builders/types.d.ts +2 -1
- package/lib/cache/adapters/default.js +5 -3
- package/lib/cache/adapters/limited.d.ts +1 -2
- package/lib/cache/adapters/limited.js +34 -30
- package/lib/cache/adapters/workeradapter.js +3 -1
- package/lib/cache/index.d.ts +8 -11
- package/lib/cache/index.js +38 -37
- package/lib/cache/resources/bans.d.ts +2 -2
- package/lib/cache/resources/bans.js +1 -1
- package/lib/cache/resources/channels.d.ts +1 -1
- package/lib/cache/resources/default/guild-related.d.ts +1 -2
- package/lib/cache/resources/emojis.d.ts +2 -2
- package/lib/cache/resources/emojis.js +1 -1
- package/lib/cache/resources/guilds.d.ts +2 -2
- package/lib/cache/resources/guilds.js +7 -11
- package/lib/cache/resources/members.d.ts +2 -2
- package/lib/cache/resources/members.js +1 -1
- package/lib/cache/resources/messages.d.ts +2 -2
- package/lib/cache/resources/messages.js +3 -3
- package/lib/cache/resources/overwrites.d.ts +1 -1
- package/lib/cache/resources/roles.d.ts +2 -2
- package/lib/cache/resources/roles.js +1 -1
- package/lib/cache/resources/stickers.d.ts +2 -2
- package/lib/cache/resources/stickers.js +1 -1
- package/lib/cache/resources/users.d.ts +2 -2
- package/lib/cache/resources/users.js +1 -1
- package/lib/cache/resources/voice-states.d.ts +2 -2
- package/lib/cache/resources/voice-states.js +1 -1
- package/lib/client/base.d.ts +9 -14
- package/lib/client/base.js +43 -44
- package/lib/client/client.d.ts +3 -7
- package/lib/client/client.js +24 -41
- package/lib/client/collectors.js +1 -1
- package/lib/client/httpclient.d.ts +1 -1
- package/lib/client/transformers.d.ts +37 -34
- package/lib/client/transformers.js +66 -63
- package/lib/client/workerclient.d.ts +10 -11
- package/lib/client/workerclient.js +180 -75
- package/lib/collection.d.ts +3 -3
- package/lib/commands/applications/chat.d.ts +12 -32
- package/lib/commands/applications/chat.js +5 -6
- package/lib/commands/applications/chatcontext.d.ts +6 -6
- package/lib/commands/applications/chatcontext.js +16 -8
- package/lib/commands/applications/entryPoint.d.ts +1 -1
- package/lib/commands/applications/entrycontext.d.ts +6 -6
- package/lib/commands/applications/entrycontext.js +4 -4
- package/lib/commands/applications/menu.d.ts +1 -1
- package/lib/commands/applications/menucontext.d.ts +5 -5
- package/lib/commands/applications/menucontext.js +6 -6
- package/lib/commands/applications/options.d.ts +104 -28
- package/lib/commands/applications/options.js +4 -4
- package/lib/commands/applications/shared.d.ts +5 -2
- package/lib/commands/basecontext.d.ts +1 -1
- package/lib/commands/decorators.d.ts +10 -10
- package/lib/commands/decorators.js +5 -4
- package/lib/commands/handle.d.ts +9 -9
- package/lib/commands/handle.js +94 -68
- package/lib/commands/handler.d.ts +5 -5
- package/lib/commands/handler.js +21 -17
- package/lib/commands/optionresolver.d.ts +4 -4
- package/lib/commands/optionresolver.js +3 -3
- package/lib/common/it/formatter.d.ts +21 -21
- package/lib/common/it/formatter.js +40 -41
- package/lib/common/it/logger.js +1 -1
- package/lib/common/it/utils.d.ts +4 -3
- package/lib/common/it/utils.js +52 -27
- package/lib/common/shorters/application.d.ts +2 -3
- package/lib/common/shorters/application.js +3 -3
- package/lib/common/shorters/bans.js +1 -1
- package/lib/common/shorters/channels.d.ts +3 -3
- package/lib/common/shorters/channels.js +3 -3
- package/lib/common/shorters/emojis.js +4 -4
- package/lib/common/shorters/guilds.d.ts +3 -3
- package/lib/common/shorters/guilds.js +5 -9
- package/lib/common/shorters/interaction.d.ts +3 -3
- package/lib/common/shorters/interaction.js +6 -5
- package/lib/common/shorters/members.d.ts +4 -5
- package/lib/common/shorters/members.js +6 -7
- package/lib/common/shorters/messages.d.ts +1 -1
- package/lib/common/shorters/messages.js +4 -4
- package/lib/common/shorters/reactions.d.ts +1 -1
- package/lib/common/shorters/reactions.js +1 -1
- package/lib/common/shorters/roles.js +1 -1
- package/lib/common/shorters/templates.js +2 -2
- package/lib/common/shorters/threads.d.ts +1 -1
- package/lib/common/shorters/threads.js +17 -11
- package/lib/common/shorters/webhook.d.ts +1 -1
- package/lib/common/shorters/webhook.js +4 -4
- package/lib/common/types/options.d.ts +2 -2
- package/lib/common/types/resolvables.d.ts +1 -1
- package/lib/common/types/util.d.ts +4 -1
- package/lib/common/types/write.d.ts +1 -1
- package/lib/components/BaseComponent.js +1 -1
- package/lib/components/ButtonComponent.d.ts +1 -1
- package/lib/components/componentcommand.d.ts +1 -1
- package/lib/components/componentcontext.d.ts +4 -4
- package/lib/components/componentcontext.js +1 -1
- package/lib/components/handler.d.ts +10 -8
- package/lib/components/handler.js +16 -13
- package/lib/components/index.js +2 -1
- package/lib/components/modalcontext.d.ts +2 -2
- package/lib/components/modalcontext.js +1 -1
- package/lib/deps/mixer.d.ts +1 -1
- package/lib/events/handler.d.ts +5 -5
- package/lib/events/handler.js +66 -16
- package/lib/events/hooks/application_command.d.ts +1 -1
- package/lib/events/hooks/auto_moderation.d.ts +1 -1
- package/lib/events/hooks/auto_moderation.js +1 -1
- package/lib/events/hooks/channel.d.ts +1 -1
- package/lib/events/hooks/dispatch.d.ts +1 -1
- package/lib/events/hooks/entitlement.d.ts +4 -5
- package/lib/events/hooks/entitlement.js +4 -4
- package/lib/events/hooks/guild.d.ts +3 -3
- package/lib/events/hooks/guild.js +1 -1
- package/lib/events/hooks/index.d.ts +1 -0
- package/lib/events/hooks/index.js +1 -0
- package/lib/events/hooks/integration.d.ts +1 -1
- package/lib/events/hooks/integration.js +1 -1
- package/lib/events/hooks/interactions.d.ts +3 -3
- package/lib/events/hooks/invite.d.ts +1 -1
- package/lib/events/hooks/message.d.ts +3 -3
- package/lib/events/hooks/message.js +1 -1
- package/lib/events/hooks/presence.d.ts +2 -2
- package/lib/events/hooks/soundboard.d.ts +155 -0
- package/lib/events/hooks/soundboard.js +28 -0
- package/lib/events/hooks/stage.d.ts +2 -2
- package/lib/events/hooks/thread.d.ts +2 -2
- package/lib/events/hooks/thread.js +2 -2
- package/lib/events/hooks/typing.d.ts +1 -1
- package/lib/events/hooks/typing.js +1 -1
- package/lib/events/hooks/user.d.ts +2 -2
- package/lib/events/hooks/voice.d.ts +2 -2
- package/lib/events/hooks/voice.js +1 -1
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -5
- package/lib/langs/handler.d.ts +2 -2
- package/lib/structures/Guild.d.ts +7 -4
- package/lib/structures/Guild.js +1 -1
- package/lib/structures/GuildBan.d.ts +1 -1
- package/lib/structures/GuildMember.d.ts +7 -5
- package/lib/structures/GuildMember.js +5 -3
- package/lib/structures/GuildRole.d.ts +1 -1
- package/lib/structures/GuildTemplate.d.ts +1 -1
- package/lib/structures/Interaction.d.ts +17 -14
- package/lib/structures/Interaction.js +28 -21
- package/lib/structures/Message.d.ts +4 -7
- package/lib/structures/Message.js +5 -5
- package/lib/structures/Poll.d.ts +3 -3
- package/lib/structures/Sticker.d.ts +2 -2
- package/lib/structures/Sticker.js +1 -1
- package/lib/structures/VoiceState.d.ts +2 -1
- package/lib/structures/VoiceState.js +1 -1
- package/lib/structures/Webhook.d.ts +3 -3
- package/lib/structures/Webhook.js +1 -1
- package/lib/structures/channels.d.ts +4 -4
- package/lib/structures/channels.js +6 -5
- package/lib/structures/extra/BitField.d.ts +3 -3
- package/lib/structures/extra/BitField.js +34 -33
- package/lib/structures/extra/DiscordBase.js +1 -1
- package/lib/structures/extra/Permissions.d.ts +2 -0
- package/lib/structures/extra/Permissions.js +21 -0
- package/lib/types/gateway.d.ts +53 -5
- package/lib/types/payloads/_interactions/base.d.ts +1 -1
- package/lib/types/payloads/channel.d.ts +2 -2
- package/lib/types/payloads/guild.d.ts +9 -1
- package/lib/types/payloads/guild.js +8 -0
- package/lib/types/payloads/index.d.ts +1 -0
- package/lib/types/payloads/index.js +1 -0
- package/lib/types/payloads/soundboard.d.ts +23 -0
- package/lib/types/payloads/soundboard.js +5 -0
- package/lib/types/payloads/user.js +0 -1
- package/lib/types/rest/application.d.ts +3 -3
- package/lib/types/rest/auditLog.d.ts +1 -1
- package/lib/types/rest/channel.d.ts +2 -2
- package/lib/types/rest/guild.d.ts +2 -2
- package/lib/types/rest/guildScheduledEvent.d.ts +1 -1
- package/lib/types/rest/index.d.ts +1 -0
- package/lib/types/rest/index.js +1 -0
- package/lib/types/rest/oauth2.d.ts +1 -1
- package/lib/types/rest/poll.d.ts +1 -1
- package/lib/types/rest/soundboard.d.ts +64 -0
- package/lib/types/rest/soundboard.js +2 -0
- package/lib/types/rest/stageInstance.d.ts +1 -1
- package/lib/types/rest/template.d.ts +1 -1
- package/lib/types/rest/user.d.ts +1 -1
- package/lib/types/rest/webhook.d.ts +1 -1
- package/lib/types/utils/index.d.ts +11 -2
- package/lib/types/utils/index.js +10 -2
- package/lib/websocket/SharedTypes.d.ts +11 -2
- package/lib/websocket/constants/index.js +0 -10
- package/lib/websocket/discord/basesocket.d.ts +1 -1
- package/lib/websocket/discord/shard.d.ts +1 -1
- package/lib/websocket/discord/shard.js +25 -16
- package/lib/websocket/discord/sharder.d.ts +9 -6
- package/lib/websocket/discord/sharder.js +91 -74
- package/lib/websocket/discord/shared.d.ts +3 -14
- package/lib/websocket/discord/socket/custom.js +19 -6
- package/lib/websocket/discord/worker.d.ts +8 -2
- package/lib/websocket/discord/workermanager.d.ts +42 -17
- package/lib/websocket/discord/workermanager.js +144 -37
- package/lib/websocket/structures/timeout.d.ts +4 -5
- package/lib/websocket/structures/timeout.js +23 -24
- package/package.json +72 -70
- package/lib/cache/resources/threads.d.ts +0 -14
- package/lib/cache/resources/threads.js +0 -32
|
@@ -8,12 +8,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.DirectoryChannel = exports.NewsChannel = exports.CategoryChannel = exports.ThreadChannel = exports.ForumChannel = exports.MediaChannel = exports.StageChannel = exports.VoiceChannel = exports.DMChannel = exports.TextGuildChannel = exports.WebhookChannelMethods = exports.WebhookGuildMethods = exports.VoiceChannelMethods = exports.ThreadOnlyMethods = exports.TopicableGuildChannel = exports.TextBaseGuildChannel = exports.MessagesMethods = exports.BaseGuildChannel = exports.BaseChannel = void 0;
|
|
10
10
|
exports.channelFrom = channelFrom;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const builders_1 = require("../builders");
|
|
13
|
-
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
14
11
|
const __1 = require("..");
|
|
12
|
+
const builders_1 = require("../builders");
|
|
15
13
|
const transformers_1 = require("../client/transformers");
|
|
16
14
|
const mixer_1 = require("../deps/mixer");
|
|
15
|
+
const types_1 = require("../types");
|
|
16
|
+
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
17
17
|
class BaseChannel extends DiscordBase_1.DiscordBase {
|
|
18
18
|
constructor(client, data) {
|
|
19
19
|
super(client, data);
|
|
@@ -101,7 +101,7 @@ class BaseGuildChannel extends BaseChannel {
|
|
|
101
101
|
}
|
|
102
102
|
permissionOverwrites = {
|
|
103
103
|
fetch: () => this.client.cache.overwrites?.get(this.id),
|
|
104
|
-
values: () => (this.guildId ? this.client.cache.overwrites?.values(this.guildId) ?? [] : []),
|
|
104
|
+
values: () => (this.guildId ? (this.client.cache.overwrites?.values(this.guildId) ?? []) : []),
|
|
105
105
|
};
|
|
106
106
|
memberPermissions(member, checkAdmin = true) {
|
|
107
107
|
return this.client.channels.memberPermissions(this.id, member, checkAdmin);
|
|
@@ -223,11 +223,12 @@ function channelFrom(data, client) {
|
|
|
223
223
|
return transformers_1.Transformers.CategoryChannel(client, data);
|
|
224
224
|
case types_1.ChannelType.GuildAnnouncement:
|
|
225
225
|
return transformers_1.Transformers.NewsChannel(client, data);
|
|
226
|
-
default:
|
|
226
|
+
default: {
|
|
227
227
|
if ('guild_id' in data) {
|
|
228
228
|
return transformers_1.Transformers.BaseGuildChannel(client, data);
|
|
229
229
|
}
|
|
230
230
|
return transformers_1.Transformers.BaseChannel(client, data);
|
|
231
|
+
}
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
class TopicableGuildChannel extends DiscordBase_1.DiscordBase {
|
|
@@ -6,12 +6,12 @@ export declare class BitField<T extends object> {
|
|
|
6
6
|
constructor(bitfields?: BitFieldResolvable<T>);
|
|
7
7
|
set bits(bits: BitFieldResolvable<T>);
|
|
8
8
|
get bits(): bigint;
|
|
9
|
-
add(...bits: BitFieldResolvable<T>[]): bigint;
|
|
10
|
-
remove(...bits: BitFieldResolvable<T>[]): bigint;
|
|
11
9
|
has(...bits: BitFieldResolvable<T>[]): boolean;
|
|
12
10
|
missings(...bits: BitFieldResolvable<T>[]): bigint[];
|
|
13
11
|
equals(other: BitFieldResolvable<T>): boolean;
|
|
14
|
-
resolve(bits?: BitFieldResolvable<T>): bigint;
|
|
15
12
|
keys(bits?: BitFieldResolvable<T>[]): string[];
|
|
16
13
|
values(bits?: BitFieldResolvable<T>[]): bigint[];
|
|
14
|
+
add(...bits: (BitFieldResolvable<T> | undefined)[]): bigint;
|
|
15
|
+
remove(...bits: BitFieldResolvable<T>[]): bigint;
|
|
16
|
+
resolve(bits: BitFieldResolvable<T>): bigint;
|
|
17
17
|
}
|
|
@@ -15,20 +15,6 @@ class BitField {
|
|
|
15
15
|
get bits() {
|
|
16
16
|
return this.bit;
|
|
17
17
|
}
|
|
18
|
-
add(...bits) {
|
|
19
|
-
let reduced = BitField.None;
|
|
20
|
-
for (const bit of bits) {
|
|
21
|
-
reduced |= this.resolve(bit);
|
|
22
|
-
}
|
|
23
|
-
return (this.bit |= reduced);
|
|
24
|
-
}
|
|
25
|
-
remove(...bits) {
|
|
26
|
-
let reduced = BitField.None;
|
|
27
|
-
for (const bit of bits) {
|
|
28
|
-
reduced |= this.resolve(bit);
|
|
29
|
-
}
|
|
30
|
-
return (this.bit &= ~reduced);
|
|
31
|
-
}
|
|
32
18
|
has(...bits) {
|
|
33
19
|
const bitsResolved = bits.map(bit => this.resolve(bit));
|
|
34
20
|
return bitsResolved.every(bit => (this.bits & bit) === bit);
|
|
@@ -40,25 +26,8 @@ class BitField {
|
|
|
40
26
|
equals(other) {
|
|
41
27
|
return this.bits === this.resolve(other);
|
|
42
28
|
}
|
|
43
|
-
resolve(bits) {
|
|
44
|
-
switch (typeof bits) {
|
|
45
|
-
case 'number':
|
|
46
|
-
return BigInt(bits);
|
|
47
|
-
case 'string':
|
|
48
|
-
return this.resolve(this.Flags[bits]);
|
|
49
|
-
case 'bigint':
|
|
50
|
-
return bits;
|
|
51
|
-
case 'object':
|
|
52
|
-
if (!Array.isArray(bits)) {
|
|
53
|
-
throw new TypeError(`Cannot resolve permission: ${bits}`);
|
|
54
|
-
}
|
|
55
|
-
return bits.map(x => this.resolve(x)).reduce((acc, cur) => acc | cur, BitField.None);
|
|
56
|
-
default:
|
|
57
|
-
throw new TypeError(`Cannot resolve permission: ${typeof bits === 'symbol' ? String(bits) : bits}`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
29
|
keys(bits = [this.bits]) {
|
|
61
|
-
const bitsResolved = bits.map(bit =>
|
|
30
|
+
const bitsResolved = bits.map(bit => this.resolve(bit));
|
|
62
31
|
return Object.entries(this.Flags).reduce((acc, value) => {
|
|
63
32
|
if (bitsResolved.some(bit => (bit & value[1]) === value[1])) {
|
|
64
33
|
acc.push(value[0]);
|
|
@@ -68,7 +37,7 @@ class BitField {
|
|
|
68
37
|
}, []);
|
|
69
38
|
}
|
|
70
39
|
values(bits = [this.bits]) {
|
|
71
|
-
const bitsResolved = bits.map(bit =>
|
|
40
|
+
const bitsResolved = bits.map(bit => this.resolve(bit));
|
|
72
41
|
return Object.entries(this.Flags).reduce((acc, value) => {
|
|
73
42
|
if (bitsResolved.some(bit => (bit & value[1]) === value[1])) {
|
|
74
43
|
acc.push(value[1]);
|
|
@@ -77,5 +46,37 @@ class BitField {
|
|
|
77
46
|
return acc;
|
|
78
47
|
}, []);
|
|
79
48
|
}
|
|
49
|
+
add(...bits) {
|
|
50
|
+
for (const bit of bits) {
|
|
51
|
+
if (!bit)
|
|
52
|
+
continue;
|
|
53
|
+
this.bits |= this.resolve(bit);
|
|
54
|
+
}
|
|
55
|
+
return this.bits;
|
|
56
|
+
}
|
|
57
|
+
remove(...bits) {
|
|
58
|
+
for (const bit of bits) {
|
|
59
|
+
this.bits &= ~this.resolve(bit);
|
|
60
|
+
}
|
|
61
|
+
return this.bits;
|
|
62
|
+
}
|
|
63
|
+
resolve(bits) {
|
|
64
|
+
switch (typeof bits) {
|
|
65
|
+
case 'string':
|
|
66
|
+
return this.resolve(this.Flags[bits]);
|
|
67
|
+
case 'number':
|
|
68
|
+
return BigInt(bits);
|
|
69
|
+
case 'bigint':
|
|
70
|
+
return bits;
|
|
71
|
+
case 'object': {
|
|
72
|
+
if (!Array.isArray(bits)) {
|
|
73
|
+
throw new TypeError(`Cannot resolve permission: ${bits}`);
|
|
74
|
+
}
|
|
75
|
+
return bits.map(x => this.resolve(x)).reduce((acc, cur) => acc | cur, BitField.None);
|
|
76
|
+
}
|
|
77
|
+
default:
|
|
78
|
+
throw new TypeError(`Cannot resolve permission: ${typeof bits === 'symbol' ? String(bits) : bits}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
80
81
|
}
|
|
81
82
|
exports.BitField = BitField;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DiscordBase = void 0;
|
|
4
|
-
const Base_1 = require("./Base");
|
|
5
4
|
const utils_1 = require("../../common/it/utils");
|
|
5
|
+
const Base_1 = require("./Base");
|
|
6
6
|
class DiscordBase extends Base_1.Base {
|
|
7
7
|
id;
|
|
8
8
|
constructor(client,
|
|
@@ -59,4 +59,6 @@ export declare class PermissionsBitField extends BitField<typeof PermissionFlags
|
|
|
59
59
|
keys: (bits?: BitFieldResolvable<typeof PermissionFlagsBits>[]) => PermissionStrings;
|
|
60
60
|
has(...bits: BitFieldResolvable<typeof PermissionFlagsBits>[]): boolean;
|
|
61
61
|
strictHas(...bits: BitFieldResolvable<typeof PermissionFlagsBits>[]): boolean;
|
|
62
|
+
resolve<T extends typeof PermissionFlagsBits>(bits: BitFieldResolvable<T>): bigint;
|
|
63
|
+
static resolve<T extends typeof PermissionFlagsBits>(bits: BitFieldResolvable<T>): bigint;
|
|
62
64
|
}
|
|
@@ -17,5 +17,26 @@ class PermissionsBitField extends BitField_1.BitField {
|
|
|
17
17
|
strictHas(...bits) {
|
|
18
18
|
return super.has(...bits);
|
|
19
19
|
}
|
|
20
|
+
resolve(bits) {
|
|
21
|
+
return PermissionsBitField.resolve(bits);
|
|
22
|
+
}
|
|
23
|
+
static resolve(bits) {
|
|
24
|
+
switch (typeof bits) {
|
|
25
|
+
case 'string':
|
|
26
|
+
return PermissionsBitField.resolve(types_1.PermissionFlagsBits[bits]);
|
|
27
|
+
case 'number':
|
|
28
|
+
return BigInt(bits);
|
|
29
|
+
case 'bigint':
|
|
30
|
+
return bits;
|
|
31
|
+
case 'object': {
|
|
32
|
+
if (!Array.isArray(bits)) {
|
|
33
|
+
throw new TypeError(`Cannot resolve permission: ${bits}`);
|
|
34
|
+
}
|
|
35
|
+
return bits.map(x => PermissionsBitField.resolve(x)).reduce((acc, cur) => acc | cur, BitField_1.BitField.None);
|
|
36
|
+
}
|
|
37
|
+
default:
|
|
38
|
+
throw new TypeError(`Cannot resolve permission: ${typeof bits === 'symbol' ? String(bits) : bits}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
20
41
|
}
|
|
21
42
|
exports.PermissionsBitField = PermissionsBitField;
|
package/lib/types/gateway.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChannelType, GatewayDispatchEvents, GatewayOpcodes, Snowflake } from './index';
|
|
2
2
|
import type { GatewayPresenceUpdate } from './payloads/gateway';
|
|
3
|
-
import type { APIApplication, APIApplicationCommandPermission,
|
|
3
|
+
import type { APIApplication, APIApplicationCommandPermission, APIAuditLogEntry, APIAutoModerationAction, APIAutoModerationRule, APIChannel, APIEmoji, APIEntitlement, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIPartialEmoji, APIRole, APIStageInstance, APISticker, APISubscription, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, APIVoiceState, AutoModerationRuleTriggerType, GatewayActivity, InviteTargetType, PresenceUpdateStatus, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayThreadListSync as RawGatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate } from './payloads/index';
|
|
4
|
+
import type { APISoundBoard } from './payloads/soundboard';
|
|
4
5
|
import type { ReactionType } from './rest/index';
|
|
5
6
|
import type { AnimationTypes, Nullable } from './utils';
|
|
6
7
|
/**
|
|
@@ -14,9 +15,9 @@ export interface GatewayURLQuery {
|
|
|
14
15
|
/**
|
|
15
16
|
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
|
16
17
|
*/
|
|
17
|
-
export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate;
|
|
18
|
+
export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate | GatewayRequestSoundboardSounds;
|
|
18
19
|
export type GatewayReceivePayload = GatewayDispatchPayload | GatewayHeartbeatAck | GatewayHeartbeatRequest | GatewayHello | GatewayInvalidSession | GatewayReconnect;
|
|
19
|
-
export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch;
|
|
20
|
+
export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch | GatewayGuildSoundboardSoundCreateDispatch | GatewayGuildSoundboardSoundDeleteDispatch | GatewayGuildSoundboardSoundUpdateDispatch | GatewayGuildSoundboardSoundsUpdateDispatch | GatewaySoundboardSoundsDispatch;
|
|
20
21
|
/**
|
|
21
22
|
* https://discord.com/developers/docs/topics/gateway-events#hello
|
|
22
23
|
*/
|
|
@@ -403,7 +404,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
|
|
403
404
|
*
|
|
404
405
|
* See https://discord.com/developers/docs/resources/channel#channel-object
|
|
405
406
|
*/
|
|
406
|
-
threads:
|
|
407
|
+
threads: APIThreadChannel[];
|
|
407
408
|
/**
|
|
408
409
|
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
|
409
410
|
*
|
|
@@ -428,6 +429,14 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
|
|
428
429
|
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
|
429
430
|
*/
|
|
430
431
|
guild_scheduled_events: APIGuildScheduledEvent[];
|
|
432
|
+
/**
|
|
433
|
+
* Soundboard sounds in the guild
|
|
434
|
+
*
|
|
435
|
+
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
|
|
436
|
+
*
|
|
437
|
+
* https://discord.com/developers/docs/resources/soundboard
|
|
438
|
+
*/
|
|
439
|
+
soundboard_sounds: APISoundBoard[];
|
|
431
440
|
}
|
|
432
441
|
/**
|
|
433
442
|
* https://discord.com/developers/docs/topics/gateway-events#guild-update
|
|
@@ -697,6 +706,31 @@ export interface GatewayGuildScheduledEventUserRemoveDispatchData {
|
|
|
697
706
|
user_id: Snowflake;
|
|
698
707
|
guild_id: Snowflake;
|
|
699
708
|
}
|
|
709
|
+
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundBoard;
|
|
710
|
+
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundCreate, GatewayGuildSoundboardSoundCreateDispatchData>;
|
|
711
|
+
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundBoard;
|
|
712
|
+
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundUpdate, GatewayGuildSoundboardSoundUpdateDispatchData>;
|
|
713
|
+
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
|
|
714
|
+
/** ID of the sound that was deleted */
|
|
715
|
+
sound_id: string;
|
|
716
|
+
/** ID of the guild the sound was in */
|
|
717
|
+
guild_id: string;
|
|
718
|
+
}
|
|
719
|
+
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundDelete, GatewayGuildSoundboardSoundDeleteDispatchData>;
|
|
720
|
+
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
|
|
721
|
+
/** The guild's soundboard sound */
|
|
722
|
+
soundboard_sounds: APISoundBoard[];
|
|
723
|
+
/** ID of the guild */
|
|
724
|
+
guild_id: string;
|
|
725
|
+
}
|
|
726
|
+
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundsUpdate, GatewayGuildSoundboardSoundsUpdateDispatchData>;
|
|
727
|
+
export interface GatewaySoundboardSoundsDispatchData {
|
|
728
|
+
/** The guild's soundboard sounds */
|
|
729
|
+
soundboard_sounds: APISoundBoard[];
|
|
730
|
+
/** ID of the guild */
|
|
731
|
+
guild_id: string;
|
|
732
|
+
}
|
|
733
|
+
export type GatewaySoundboardSoundsDispatch = DataPayload<GatewayDispatchEvents.SoundboardSounds, GatewaySoundboardSoundsDispatchData>;
|
|
700
734
|
/**
|
|
701
735
|
* https://discord.com/developers/docs/topics/gateway-events#integration-create
|
|
702
736
|
*/
|
|
@@ -1400,6 +1434,20 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
|
|
|
1400
1434
|
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
|
|
1401
1435
|
*/
|
|
1402
1436
|
export type GatewayRequestGuildMembersData = GatewayRequestGuildMembersDataWithQuery | GatewayRequestGuildMembersDataWithUserIds;
|
|
1437
|
+
/**
|
|
1438
|
+
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
|
|
1439
|
+
*/
|
|
1440
|
+
export interface GatewayRequestSoundboardSounds {
|
|
1441
|
+
op: GatewayOpcodes.RequestSoundboardSounds;
|
|
1442
|
+
d: GatewayRequestSoundboardSoundsData;
|
|
1443
|
+
}
|
|
1444
|
+
/**
|
|
1445
|
+
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds-request-soundboard-sounds-structure
|
|
1446
|
+
*/
|
|
1447
|
+
export interface GatewayRequestSoundboardSoundsData {
|
|
1448
|
+
/** IDs of the guilds to get soundboard sounds for */
|
|
1449
|
+
guild_ids: string[];
|
|
1450
|
+
}
|
|
1403
1451
|
/**
|
|
1404
1452
|
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
|
|
1405
1453
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApplicationIntegrationType, InteractionContextType } from '..';
|
|
2
2
|
import type { ChannelType, Snowflake } from '../..';
|
|
3
3
|
import type { LocaleString } from '../../rest';
|
|
4
4
|
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadChannel, ThreadChannelType } from '../channel';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types extracted from https://discord.com/developers/docs/resources/channel
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '../index';
|
|
5
5
|
import type { APIApplication } from './application';
|
|
6
6
|
import type { APIPartialEmoji } from './emoji';
|
|
7
7
|
import type { APIGuildMember } from './guild';
|
|
@@ -520,7 +520,7 @@ export interface APIMessage {
|
|
|
520
520
|
/**
|
|
521
521
|
* Sent if a thread was started from this message
|
|
522
522
|
*/
|
|
523
|
-
thread?:
|
|
523
|
+
thread?: APIThreadChannel;
|
|
524
524
|
/**
|
|
525
525
|
* Sent if the message contains components like buttons, action rows, or other interactive components
|
|
526
526
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types extracted from https://discord.com/developers/docs/resources/guild
|
|
3
3
|
*/
|
|
4
|
-
import type { Permissions, Snowflake
|
|
4
|
+
import type { GuildMemberFlags, Permissions, Snowflake } from '../index';
|
|
5
5
|
import type { APIEmoji, APIPartialEmoji } from './emoji';
|
|
6
6
|
import type { PresenceUpdateReceiveStatus } from './gateway';
|
|
7
7
|
import type { OAuth2Scopes } from './oauth2';
|
|
@@ -458,6 +458,10 @@ export declare enum GuildFeature {
|
|
|
458
458
|
* Guild has enabled Membership Screening
|
|
459
459
|
*/
|
|
460
460
|
MemberVerificationGateEnabled = "MEMBER_VERIFICATION_GATE_ENABLED",
|
|
461
|
+
/**
|
|
462
|
+
* Guild has increased custom soundboard sound slots
|
|
463
|
+
*/
|
|
464
|
+
MoreSoundboard = "MORE_SOUNDBOARD",
|
|
461
465
|
/**
|
|
462
466
|
* Guild has enabled monetization
|
|
463
467
|
*
|
|
@@ -501,6 +505,10 @@ export declare enum GuildFeature {
|
|
|
501
505
|
* Guild has enabled role subscriptions
|
|
502
506
|
*/
|
|
503
507
|
RoleSubscriptionsEnabled = "ROLE_SUBSCRIPTIONS_ENABLED",
|
|
508
|
+
/**
|
|
509
|
+
* Guild has created soundboard sounds
|
|
510
|
+
*/
|
|
511
|
+
Soundboard = "SOUNDBOARD",
|
|
504
512
|
/**
|
|
505
513
|
* Guild has enabled ticketed events
|
|
506
514
|
*/
|
|
@@ -194,6 +194,10 @@ var GuildFeature;
|
|
|
194
194
|
* Guild has enabled Membership Screening
|
|
195
195
|
*/
|
|
196
196
|
GuildFeature["MemberVerificationGateEnabled"] = "MEMBER_VERIFICATION_GATE_ENABLED";
|
|
197
|
+
/**
|
|
198
|
+
* Guild has increased custom soundboard sound slots
|
|
199
|
+
*/
|
|
200
|
+
GuildFeature["MoreSoundboard"] = "MORE_SOUNDBOARD";
|
|
197
201
|
/**
|
|
198
202
|
* Guild has enabled monetization
|
|
199
203
|
*
|
|
@@ -237,6 +241,10 @@ var GuildFeature;
|
|
|
237
241
|
* Guild has enabled role subscriptions
|
|
238
242
|
*/
|
|
239
243
|
GuildFeature["RoleSubscriptionsEnabled"] = "ROLE_SUBSCRIPTIONS_ENABLED";
|
|
244
|
+
/**
|
|
245
|
+
* Guild has created soundboard sounds
|
|
246
|
+
*/
|
|
247
|
+
GuildFeature["Soundboard"] = "SOUNDBOARD";
|
|
240
248
|
/**
|
|
241
249
|
* Guild has enabled ticketed events
|
|
242
250
|
*/
|
|
@@ -19,6 +19,7 @@ export * from './user';
|
|
|
19
19
|
export * from './voice';
|
|
20
20
|
export * from './webhook';
|
|
21
21
|
export * from './monetization';
|
|
22
|
+
export * from './soundboard';
|
|
22
23
|
import type { LocaleString } from '../rest';
|
|
23
24
|
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
|
|
24
25
|
/**
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types extracted from https://discord.com/developers/docs/resources/soundboard
|
|
3
|
+
*/
|
|
4
|
+
import type { APIUser } from './user';
|
|
5
|
+
/** https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object-soundboard-sound-structure */
|
|
6
|
+
export interface APISoundBoard {
|
|
7
|
+
/** the name of this sound */
|
|
8
|
+
name: string;
|
|
9
|
+
/** the id of this sound */
|
|
10
|
+
sound_id: string;
|
|
11
|
+
/** the volume of this sound, from 0 to 1 */
|
|
12
|
+
volume: number;
|
|
13
|
+
/** the id of this sound's custom emoji */
|
|
14
|
+
emoji_id: string | null;
|
|
15
|
+
/** the unicode character of this sound's standard emoji */
|
|
16
|
+
emoji_name: string | null;
|
|
17
|
+
/** the id of the guild this sound is in */
|
|
18
|
+
guild_id?: string;
|
|
19
|
+
/** whether this sound can be used, may be false due to loss of Server Boosts */
|
|
20
|
+
available: boolean;
|
|
21
|
+
/** the user who created this sound */
|
|
22
|
+
user?: APIUser;
|
|
23
|
+
}
|
|
@@ -149,7 +149,6 @@ var ConnectionService;
|
|
|
149
149
|
/**
|
|
150
150
|
* @deprecated This is the old name for {@apilink ConnectionService#X}
|
|
151
151
|
*/
|
|
152
|
-
// biome-ignore lint/correctness/noUndeclaredVariables: biome bug lol
|
|
153
152
|
ConnectionService["Twitter"] = "twitter";
|
|
154
153
|
ConnectionService["Xbox"] = "xbox";
|
|
155
154
|
ConnectionService["YouTube"] = "youtube";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { APIApplication, APIApplicationRoleConnectionMetadata, APIEmoji } from '../payloads';
|
|
2
|
+
import type { Nullable, StrictPartial } from '../utils';
|
|
3
|
+
import type { RESTPatchAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiJSONBody } from './emoji';
|
|
4
4
|
/**
|
|
5
5
|
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '..';
|
|
2
|
+
import type { APIActionRowComponent, APIAllowedMentions, APIAttachment, APIChannel, APIEmbed, APIExtendedInvite, APIFollowedChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIMessage, APIMessageActionRowComponent, APIMessageReference, APIThreadList, APIThreadMember, APIUser, ChannelFlags, ForumLayoutType, InviteTargetType, MessageFlags, SortOrderType, ThreadAutoArchiveDuration, ThreadChannelType } from '../payloads';
|
|
3
3
|
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../utils';
|
|
4
4
|
import type { RESTAPIPollCreate } from './poll';
|
|
5
5
|
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Snowflake } from '..';
|
|
2
|
-
import type { APIChannel, APIDMChannel, APIGroupDMChannel,
|
|
3
|
-
import type {
|
|
2
|
+
import type { APIBan, APIChannel, APIDMChannel, APIExtendedInvite, APIGroupDMChannel, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildMembershipScreening, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, APIGuildPreview, APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetSettings, APIRole, APIThreadList, APIVoiceRegion, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildFeature, GuildMFALevel, GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle } from '../payloads';
|
|
3
|
+
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, DistributiveOmit, DistributivePick, Nullable, StrictPartial, StrictRequired } from '../utils';
|
|
4
4
|
import type { RESTPutAPIChannelPermissionJSONBody } from './channel';
|
|
5
5
|
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
|
6
6
|
id: number | string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snowflake } from '..';
|
|
2
|
-
import type { APIGuildScheduledEvent,
|
|
2
|
+
import type { APIGuildScheduledEvent, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEventUser, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventStatus } from '../payloads';
|
|
3
3
|
import type { StrictPartial } from '../utils';
|
|
4
4
|
/**
|
|
5
5
|
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
|
@@ -18,6 +18,7 @@ export * from './user';
|
|
|
18
18
|
export * from './voice';
|
|
19
19
|
export * from './webhook';
|
|
20
20
|
export * from './monetization';
|
|
21
|
+
export * from './soundboard';
|
|
21
22
|
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
|
|
22
23
|
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
|
23
24
|
export type GuildIconFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
package/lib/types/rest/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./user"), exports);
|
|
|
34
34
|
__exportStar(require("./voice"), exports);
|
|
35
35
|
__exportStar(require("./webhook"), exports);
|
|
36
36
|
__exportStar(require("./monetization"), exports);
|
|
37
|
+
__exportStar(require("./soundboard"), exports);
|
|
37
38
|
/**
|
|
38
39
|
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
|
|
39
40
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snowflake } from '..';
|
|
2
|
-
import type { APIApplication,
|
|
2
|
+
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../payloads';
|
|
3
3
|
/**
|
|
4
4
|
* https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
|
|
5
5
|
*/
|
package/lib/types/rest/poll.d.ts
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { APISoundBoard } from '../payloads/soundboard';
|
|
2
|
+
/**
|
|
3
|
+
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
|
|
4
|
+
* @fires VoiceChannelEffectSend
|
|
5
|
+
* @requires Permissions Speak and UseSoundboard
|
|
6
|
+
* @satisfies VoiceState without deaf, self_deaf, mute, or suppress enabled.
|
|
7
|
+
*/
|
|
8
|
+
export interface RESTPostAPISendSoundboardSound {
|
|
9
|
+
/** the id of the soundboard sound to play */
|
|
10
|
+
sound_id: string;
|
|
11
|
+
/** the id of the guild the soundboard sound is from, required to play sounds from different servers */
|
|
12
|
+
source_guild_id?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds
|
|
16
|
+
*/
|
|
17
|
+
export type RESTGetAPIDefaultsSoundboardSoundsResult = Omit<APISoundBoard, 'user' | 'guild_id'>[];
|
|
18
|
+
/**
|
|
19
|
+
* https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
|
|
20
|
+
*/
|
|
21
|
+
export type RESTGetAPIGuildSoundboardSoundsResult = {
|
|
22
|
+
items: APISoundBoard[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
|
|
26
|
+
*
|
|
27
|
+
* Soundboard sounds have a max file size of 512kb and a max duration of 5.2 seconds.
|
|
28
|
+
* This endpoint supports the X-Audit-Log-Reason header.
|
|
29
|
+
* @requires Permission CreateGuildExpressions
|
|
30
|
+
*/
|
|
31
|
+
export interface RESTPostAPIGuildSoundboardSound {
|
|
32
|
+
/** name of the soundboard sound (2-32 characters) */
|
|
33
|
+
name: string;
|
|
34
|
+
/** the mp3 or ogg sound data, base64 encoded, similar to image data */
|
|
35
|
+
sound: string;
|
|
36
|
+
/** the volume of the soundboard sound, from 0 to 1, defaults to 1 */
|
|
37
|
+
volume?: number | null;
|
|
38
|
+
/** the id of the custom emoji for the soundboard sound */
|
|
39
|
+
emoji_id?: string | null;
|
|
40
|
+
/** the unicode character of a standard emoji for the soundboard sound */
|
|
41
|
+
emoji_name?: string | null;
|
|
42
|
+
}
|
|
43
|
+
export type RESTPostAPIGuildSoundboardSoundResult = APISoundBoard;
|
|
44
|
+
/**
|
|
45
|
+
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
|
|
46
|
+
* @fires GuildSoundboardSoundUpdate
|
|
47
|
+
*/
|
|
48
|
+
export interface RESTPatchAPIGuildSoundboardSound {
|
|
49
|
+
/** name of the soundboard sound (2-32 characters) */
|
|
50
|
+
name?: string;
|
|
51
|
+
/** the volume of the soundboard sound, from 0 to 1, defaults to 1 */
|
|
52
|
+
volume?: number | null;
|
|
53
|
+
/** the id of the custom emoji for the soundboard sound */
|
|
54
|
+
emoji_id?: string | null;
|
|
55
|
+
/** the unicode character of a standard emoji for the soundboard sound */
|
|
56
|
+
emoji_name?: string | null;
|
|
57
|
+
}
|
|
58
|
+
export type RESTPatchAPIGuildSoundboardSoundResult = APISoundBoard;
|
|
59
|
+
/**
|
|
60
|
+
* https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
|
|
61
|
+
* This endpoint supports the X-Audit-Log-Reason header.
|
|
62
|
+
* @fires GuildSoundboardSoundDelete
|
|
63
|
+
*/
|
|
64
|
+
export type RESTDeleteAPIGuildSoundboardSoundResult = never;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snowflake } from '..';
|
|
2
|
-
import type {
|
|
2
|
+
import type { APIStageInstance, StageInstancePrivacyLevel } from '../payloads';
|
|
3
3
|
/**
|
|
4
4
|
* https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
|
|
5
5
|
*/
|
package/lib/types/rest/user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snowflake } from '..';
|
|
2
|
-
import type {
|
|
2
|
+
import type { APIApplicationRoleConnection, APIChannel, APIConnection, APIGuildMember, APIUser, GuildFeature } from '../payloads';
|
|
3
3
|
/**
|
|
4
4
|
* https://discord.com/developers/docs/resources/user#get-current-user
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snowflake } from '..';
|
|
2
|
-
import type {
|
|
2
|
+
import type { APIActionRowComponent, APIAllowedMentions, APIEmbed, APIMessage, APIMessageActionRowComponent, APIWebhook, MessageFlags } from '../payloads';
|
|
3
3
|
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../utils';
|
|
4
4
|
import type { RESTAPIAttachment } from './channel';
|
|
5
5
|
import type { RESTAPIPollCreate } from './poll';
|