@zygout/eris 0.19.0 → 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 -20
- package/README.md +109 -80
- package/esm.mjs +72 -72
- package/index.d.ts +4407 -4397
- package/index.js +75 -75
- package/lib/Client.js +4708 -4683
- package/lib/Constants.d.ts +990 -988
- package/lib/Constants.js +1163 -1161
- package/lib/command/Command.js +552 -552
- package/lib/command/CommandClient.js +460 -460
- package/lib/errors/DiscordHTTPError.js +63 -63
- package/lib/errors/DiscordRESTError.js +77 -77
- package/lib/gateway/Shard.js +3029 -3029
- package/lib/gateway/ShardManager.js +164 -164
- package/lib/rest/Endpoints.js +172 -172
- package/lib/rest/RequestHandler.js +459 -459
- package/lib/structures/ApplicationCommand.js +125 -125
- package/lib/structures/AutoModerationRule.js +143 -143
- package/lib/structures/AutocompleteInteraction.js +80 -80
- package/lib/structures/Base.js +81 -81
- package/lib/structures/CategoryChannel.js +77 -77
- package/lib/structures/Channel.js +98 -98
- package/lib/structures/CommandInteraction.js +473 -473
- package/lib/structures/ComponentInteraction.js +538 -538
- package/lib/structures/DMChannel.js +278 -278
- package/lib/structures/Entitlement.js +77 -77
- package/lib/structures/ExtendedUser.js +46 -46
- package/lib/structures/ForumChannel.js +24 -24
- package/lib/structures/GroupChannel.js +106 -106
- package/lib/structures/Guild.js +1677 -1677
- package/lib/structures/GuildAuditLogEntry.js +190 -190
- package/lib/structures/GuildChannel.js +128 -128
- package/lib/structures/GuildIntegration.js +99 -99
- package/lib/structures/GuildPreview.js +97 -97
- package/lib/structures/GuildScheduledEvent.js +176 -176
- package/lib/structures/GuildTemplate.js +76 -76
- package/lib/structures/GuildTextableChannel.js +260 -260
- package/lib/structures/Interaction.js +133 -133
- package/lib/structures/Invite.js +143 -143
- package/lib/structures/Lobby.js +108 -108
- package/lib/structures/LobbyMember.js +59 -59
- package/lib/structures/MediaChannel.js +216 -216
- package/lib/structures/Member.js +371 -371
- package/lib/structures/Message.js +708 -708
- package/lib/structures/ModalSubmitInteraction.js +478 -478
- package/lib/structures/NewsChannel.js +34 -34
- package/lib/structures/NewsThreadChannel.js +12 -12
- package/lib/structures/Permission.js +80 -80
- package/lib/structures/PermissionOverwrite.js +32 -32
- package/lib/structures/PingInteraction.js +39 -39
- package/lib/structures/PrivateThreadChannel.js +25 -25
- package/lib/structures/PublicThreadChannel.js +26 -26
- package/lib/structures/Role.js +163 -163
- package/lib/structures/SKU.js +80 -80
- package/lib/structures/SoundboardSound.js +79 -79
- package/lib/structures/StageChannel.js +59 -59
- package/lib/structures/StageInstance.js +55 -55
- package/lib/structures/Subscription.js +69 -69
- package/lib/structures/TextChannel.js +202 -202
- package/lib/structures/ThreadChannel.js +143 -143
- package/lib/structures/ThreadMember.js +59 -59
- package/lib/structures/UnavailableGuild.js +26 -26
- package/lib/structures/UnknownInteraction.js +502 -502
- package/lib/structures/User.js +296 -296
- package/lib/structures/VoiceChannel.js +166 -166
- package/lib/structures/VoiceState.js +84 -84
- package/lib/util/BrowserWebSocket.js +76 -76
- package/lib/util/Bucket.js +89 -89
- package/lib/util/Collection.js +202 -202
- package/lib/util/MultipartData.js +70 -70
- package/lib/util/Opus.js +33 -33
- package/lib/util/SequentialBucket.js +83 -83
- package/lib/util/emitDeprecation.js +26 -26
- package/lib/voice/Piper.js +300 -300
- package/lib/voice/SharedStream.js +238 -238
- package/lib/voice/VoiceConnection.js +1440 -1440
- package/lib/voice/VoiceConnectionManager.js +151 -151
- package/lib/voice/VoiceDataStream.js +22 -22
- package/lib/voice/streams/BaseTransformer.js +40 -40
- package/lib/voice/streams/DCAOpusTransformer.js +78 -78
- package/lib/voice/streams/FFmpegDuplex.js +192 -192
- package/lib/voice/streams/FFmpegOggTransformer.js +35 -35
- package/lib/voice/streams/FFmpegPCMTransformer.js +26 -26
- package/lib/voice/streams/OggOpusTransformer.js +108 -108
- package/lib/voice/streams/PCMOpusTransformer.js +61 -61
- package/lib/voice/streams/VolumeTransformer.js +50 -50
- package/lib/voice/streams/WebmOpusTransformer.js +258 -258
- package/package.json +83 -82
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Base = require("./Base");
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents a guild integration
|
|
7
|
-
* @prop {Object} account Info on the integration account
|
|
8
|
-
* @prop {String} account.id The ID of the integration account
|
|
9
|
-
* @prop {String} account.name The name of the integration account
|
|
10
|
-
* @prop {Object?} application The bot/OAuth2 application for Discord integrations. See [the Discord docs](https://discord.com/developers/docs/resources/guild#integration-application-object)
|
|
11
|
-
* @prop {Number} createdAt Timestamp of the guild integration's creation
|
|
12
|
-
* @prop {Boolean} enabled Whether the integration is enabled or not
|
|
13
|
-
* @prop {Boolean?} enableEmoticons Whether integration emoticons are enabled or not
|
|
14
|
-
* @prop {Number?} expireBehavior behavior of expired subscriptions
|
|
15
|
-
* @prop {Number?} expireGracePeriod grace period for expired subscriptions
|
|
16
|
-
* @prop {String} id The ID of the integration
|
|
17
|
-
* @prop {String} name The name of the integration
|
|
18
|
-
* @prop {Boolean?} revoked Whether or not the application was revoked
|
|
19
|
-
* @prop {String?} roleID The ID of the role connected to the integration
|
|
20
|
-
* @prop {Number?} subscriberCount number of subscribers
|
|
21
|
-
* @prop {Number?} syncedAt Unix timestamp of last integration sync
|
|
22
|
-
* @prop {Boolean?} syncing Whether the integration is syncing or not
|
|
23
|
-
* @prop {String} type The type of the integration
|
|
24
|
-
* @prop {User?} user The user connected to the integration
|
|
25
|
-
*/
|
|
26
|
-
class GuildIntegration extends Base {
|
|
27
|
-
constructor(data, guild) {
|
|
28
|
-
super(data.id);
|
|
29
|
-
this.guild = guild;
|
|
30
|
-
this.name = data.name;
|
|
31
|
-
this.type = data.type;
|
|
32
|
-
if (data.role_id !== undefined) {
|
|
33
|
-
this.roleID = data.role_id;
|
|
34
|
-
}
|
|
35
|
-
if (data.user) {
|
|
36
|
-
this.user = guild.shard.client.users.add(data.user, guild.shard.client);
|
|
37
|
-
}
|
|
38
|
-
this.account = data.account; // not worth making a class for
|
|
39
|
-
this.update(data);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
update(data) {
|
|
43
|
-
this.enabled = data.enabled;
|
|
44
|
-
if (data.syncing !== undefined) {
|
|
45
|
-
this.syncing = data.syncing;
|
|
46
|
-
}
|
|
47
|
-
if (data.expire_behavior !== undefined) {
|
|
48
|
-
this.expireBehavior = data.expire_behavior;
|
|
49
|
-
}
|
|
50
|
-
if (data.expire_behavior !== undefined) {
|
|
51
|
-
this.expireGracePeriod = data.expire_grace_period;
|
|
52
|
-
}
|
|
53
|
-
if (data.enable_emoticons) {
|
|
54
|
-
this.enableEmoticons = data.enable_emoticons;
|
|
55
|
-
}
|
|
56
|
-
if (data.subscriber_count !== undefined) {
|
|
57
|
-
this.subscriberCount = data.subscriber_count;
|
|
58
|
-
}
|
|
59
|
-
if (data.synced_at !== undefined) {
|
|
60
|
-
this.syncedAt = data.synced_at;
|
|
61
|
-
}
|
|
62
|
-
if (data.revoked !== undefined) {
|
|
63
|
-
this.revoked = data.revoked;
|
|
64
|
-
}
|
|
65
|
-
if (data.application !== undefined) {
|
|
66
|
-
this.application = data.application;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Delete the guild integration
|
|
72
|
-
* @returns {Promise}
|
|
73
|
-
*/
|
|
74
|
-
delete() {
|
|
75
|
-
return this.guild.shard.client.deleteGuildIntegration.call(this.guild.shard.client, this.guild.id, this.id);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
toJSON(props = []) {
|
|
79
|
-
return super.toJSON([
|
|
80
|
-
"account",
|
|
81
|
-
"application",
|
|
82
|
-
"enabled",
|
|
83
|
-
"enableEmoticons",
|
|
84
|
-
"expireBehavior",
|
|
85
|
-
"expireGracePeriod",
|
|
86
|
-
"name",
|
|
87
|
-
"revoked",
|
|
88
|
-
"roleID",
|
|
89
|
-
"subscriberCount",
|
|
90
|
-
"syncedAt",
|
|
91
|
-
"syncing",
|
|
92
|
-
"type",
|
|
93
|
-
"user",
|
|
94
|
-
...props,
|
|
95
|
-
]);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
module.exports = GuildIntegration;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("./Base");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a guild integration
|
|
7
|
+
* @prop {Object} account Info on the integration account
|
|
8
|
+
* @prop {String} account.id The ID of the integration account
|
|
9
|
+
* @prop {String} account.name The name of the integration account
|
|
10
|
+
* @prop {Object?} application The bot/OAuth2 application for Discord integrations. See [the Discord docs](https://discord.com/developers/docs/resources/guild#integration-application-object)
|
|
11
|
+
* @prop {Number} createdAt Timestamp of the guild integration's creation
|
|
12
|
+
* @prop {Boolean} enabled Whether the integration is enabled or not
|
|
13
|
+
* @prop {Boolean?} enableEmoticons Whether integration emoticons are enabled or not
|
|
14
|
+
* @prop {Number?} expireBehavior behavior of expired subscriptions
|
|
15
|
+
* @prop {Number?} expireGracePeriod grace period for expired subscriptions
|
|
16
|
+
* @prop {String} id The ID of the integration
|
|
17
|
+
* @prop {String} name The name of the integration
|
|
18
|
+
* @prop {Boolean?} revoked Whether or not the application was revoked
|
|
19
|
+
* @prop {String?} roleID The ID of the role connected to the integration
|
|
20
|
+
* @prop {Number?} subscriberCount number of subscribers
|
|
21
|
+
* @prop {Number?} syncedAt Unix timestamp of last integration sync
|
|
22
|
+
* @prop {Boolean?} syncing Whether the integration is syncing or not
|
|
23
|
+
* @prop {String} type The type of the integration
|
|
24
|
+
* @prop {User?} user The user connected to the integration
|
|
25
|
+
*/
|
|
26
|
+
class GuildIntegration extends Base {
|
|
27
|
+
constructor(data, guild) {
|
|
28
|
+
super(data.id);
|
|
29
|
+
this.guild = guild;
|
|
30
|
+
this.name = data.name;
|
|
31
|
+
this.type = data.type;
|
|
32
|
+
if (data.role_id !== undefined) {
|
|
33
|
+
this.roleID = data.role_id;
|
|
34
|
+
}
|
|
35
|
+
if (data.user) {
|
|
36
|
+
this.user = guild.shard.client.users.add(data.user, guild.shard.client);
|
|
37
|
+
}
|
|
38
|
+
this.account = data.account; // not worth making a class for
|
|
39
|
+
this.update(data);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
update(data) {
|
|
43
|
+
this.enabled = data.enabled;
|
|
44
|
+
if (data.syncing !== undefined) {
|
|
45
|
+
this.syncing = data.syncing;
|
|
46
|
+
}
|
|
47
|
+
if (data.expire_behavior !== undefined) {
|
|
48
|
+
this.expireBehavior = data.expire_behavior;
|
|
49
|
+
}
|
|
50
|
+
if (data.expire_behavior !== undefined) {
|
|
51
|
+
this.expireGracePeriod = data.expire_grace_period;
|
|
52
|
+
}
|
|
53
|
+
if (data.enable_emoticons) {
|
|
54
|
+
this.enableEmoticons = data.enable_emoticons;
|
|
55
|
+
}
|
|
56
|
+
if (data.subscriber_count !== undefined) {
|
|
57
|
+
this.subscriberCount = data.subscriber_count;
|
|
58
|
+
}
|
|
59
|
+
if (data.synced_at !== undefined) {
|
|
60
|
+
this.syncedAt = data.synced_at;
|
|
61
|
+
}
|
|
62
|
+
if (data.revoked !== undefined) {
|
|
63
|
+
this.revoked = data.revoked;
|
|
64
|
+
}
|
|
65
|
+
if (data.application !== undefined) {
|
|
66
|
+
this.application = data.application;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Delete the guild integration
|
|
72
|
+
* @returns {Promise}
|
|
73
|
+
*/
|
|
74
|
+
delete() {
|
|
75
|
+
return this.guild.shard.client.deleteGuildIntegration.call(this.guild.shard.client, this.guild.id, this.id);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
toJSON(props = []) {
|
|
79
|
+
return super.toJSON([
|
|
80
|
+
"account",
|
|
81
|
+
"application",
|
|
82
|
+
"enabled",
|
|
83
|
+
"enableEmoticons",
|
|
84
|
+
"expireBehavior",
|
|
85
|
+
"expireGracePeriod",
|
|
86
|
+
"name",
|
|
87
|
+
"revoked",
|
|
88
|
+
"roleID",
|
|
89
|
+
"subscriberCount",
|
|
90
|
+
"syncedAt",
|
|
91
|
+
"syncing",
|
|
92
|
+
"type",
|
|
93
|
+
"user",
|
|
94
|
+
...props,
|
|
95
|
+
]);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
module.exports = GuildIntegration;
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Base = require("./Base");
|
|
4
|
-
const Endpoints = require("../rest/Endpoints.js");
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Represents a GuildPreview structure
|
|
8
|
-
* @extends Base
|
|
9
|
-
* @prop {Number} approximateMemberCount The **approximate** number of members in the guild
|
|
10
|
-
* @prop {Number} approximatePresenceCount The **approximate** number of presences in the guild
|
|
11
|
-
* @prop {String?} description The description for the guild (VIP only)
|
|
12
|
-
* @prop {String?} discoverySplash The hash of the guild discovery splash image, or null if no splash
|
|
13
|
-
* @prop {String?} discoverySplashURL The URL of the guild's discovery splash image
|
|
14
|
-
* @prop {Array<Object>} emojis An array of guild emoji objects
|
|
15
|
-
* @prop {Array<String>} features An array of guild feature strings
|
|
16
|
-
* @prop {String?} icon The hash of the guild icon, or null if no icon
|
|
17
|
-
* @prop {String?} iconURL The URL of the guild's icon
|
|
18
|
-
* @prop {String} id The ID of the guild
|
|
19
|
-
* @prop {String} name The name of the guild
|
|
20
|
-
* @prop {String?} splash The hash of the guild splash image, or null if no splash (VIP only)
|
|
21
|
-
* @prop {String?} splashURL The URL of the guild's splash image
|
|
22
|
-
*/
|
|
23
|
-
class GuildPreview extends Base {
|
|
24
|
-
constructor(data, client) {
|
|
25
|
-
super(data.id);
|
|
26
|
-
this._client = client;
|
|
27
|
-
|
|
28
|
-
this.name = data.name;
|
|
29
|
-
this.icon = data.icon;
|
|
30
|
-
this.description = data.description;
|
|
31
|
-
this.splash = data.splash;
|
|
32
|
-
this.discoverySplash = data.discovery_splash;
|
|
33
|
-
this.features = data.features;
|
|
34
|
-
this.approximateMemberCount = data.approximate_member_count;
|
|
35
|
-
this.approximatePresenceCount = data.approximate_presence_count;
|
|
36
|
-
this.emojis = data.emojis;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
get iconURL() {
|
|
40
|
-
return this.icon ? this._client._formatImage(Endpoints.GUILD_ICON(this.id, this.icon)) : null;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
get splashURL() {
|
|
44
|
-
return this.splash ? this._client._formatImage(Endpoints.GUILD_SPLASH(this.id, this.splash)) : null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
get discoverySplashURL() {
|
|
48
|
-
return this.discoverySplash ? this._client._formatImage(Endpoints.GUILD_DISCOVERY_SPLASH(this.id, this.discoverySplash)) : null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Get the guild's splash with the given format and size
|
|
53
|
-
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
|
|
54
|
-
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
|
|
55
|
-
* @returns {String?}
|
|
56
|
-
*/
|
|
57
|
-
dynamicDiscoverySplashURL(format, size) {
|
|
58
|
-
return this.discoverySplash ? this._client._formatImage(Endpoints.GUILD_DISCOVERY_SPLASH(this.id, this.discoverySplash), format, size) : null;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Get the guild's icon with the given format and size
|
|
63
|
-
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
|
|
64
|
-
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
|
|
65
|
-
* @returns {String?}
|
|
66
|
-
*/
|
|
67
|
-
dynamicIconURL(format, size) {
|
|
68
|
-
return this.icon ? this._client._formatImage(Endpoints.GUILD_ICON(this.id, this.icon), format, size) : null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Get the guild's splash with the given format and size
|
|
73
|
-
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
|
|
74
|
-
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
|
|
75
|
-
* @returns {String?}
|
|
76
|
-
*/
|
|
77
|
-
dynamicSplashURL(format, size) {
|
|
78
|
-
return this.splash ? this._client._formatImage(Endpoints.GUILD_SPLASH(this.id, this.splash), format, size) : null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
toJSON(props = []) {
|
|
82
|
-
return super.toJSON([
|
|
83
|
-
"approximateMemberCount",
|
|
84
|
-
"approximatePresenceCount",
|
|
85
|
-
"description",
|
|
86
|
-
"discoverySplash",
|
|
87
|
-
"emojis",
|
|
88
|
-
"features",
|
|
89
|
-
"icon",
|
|
90
|
-
"name",
|
|
91
|
-
"splash",
|
|
92
|
-
...props,
|
|
93
|
-
]);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
module.exports = GuildPreview;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Base = require("./Base");
|
|
4
|
+
const Endpoints = require("../rest/Endpoints.js");
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents a GuildPreview structure
|
|
8
|
+
* @extends Base
|
|
9
|
+
* @prop {Number} approximateMemberCount The **approximate** number of members in the guild
|
|
10
|
+
* @prop {Number} approximatePresenceCount The **approximate** number of presences in the guild
|
|
11
|
+
* @prop {String?} description The description for the guild (VIP only)
|
|
12
|
+
* @prop {String?} discoverySplash The hash of the guild discovery splash image, or null if no splash
|
|
13
|
+
* @prop {String?} discoverySplashURL The URL of the guild's discovery splash image
|
|
14
|
+
* @prop {Array<Object>} emojis An array of guild emoji objects
|
|
15
|
+
* @prop {Array<String>} features An array of guild feature strings
|
|
16
|
+
* @prop {String?} icon The hash of the guild icon, or null if no icon
|
|
17
|
+
* @prop {String?} iconURL The URL of the guild's icon
|
|
18
|
+
* @prop {String} id The ID of the guild
|
|
19
|
+
* @prop {String} name The name of the guild
|
|
20
|
+
* @prop {String?} splash The hash of the guild splash image, or null if no splash (VIP only)
|
|
21
|
+
* @prop {String?} splashURL The URL of the guild's splash image
|
|
22
|
+
*/
|
|
23
|
+
class GuildPreview extends Base {
|
|
24
|
+
constructor(data, client) {
|
|
25
|
+
super(data.id);
|
|
26
|
+
this._client = client;
|
|
27
|
+
|
|
28
|
+
this.name = data.name;
|
|
29
|
+
this.icon = data.icon;
|
|
30
|
+
this.description = data.description;
|
|
31
|
+
this.splash = data.splash;
|
|
32
|
+
this.discoverySplash = data.discovery_splash;
|
|
33
|
+
this.features = data.features;
|
|
34
|
+
this.approximateMemberCount = data.approximate_member_count;
|
|
35
|
+
this.approximatePresenceCount = data.approximate_presence_count;
|
|
36
|
+
this.emojis = data.emojis;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get iconURL() {
|
|
40
|
+
return this.icon ? this._client._formatImage(Endpoints.GUILD_ICON(this.id, this.icon)) : null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get splashURL() {
|
|
44
|
+
return this.splash ? this._client._formatImage(Endpoints.GUILD_SPLASH(this.id, this.splash)) : null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get discoverySplashURL() {
|
|
48
|
+
return this.discoverySplash ? this._client._formatImage(Endpoints.GUILD_DISCOVERY_SPLASH(this.id, this.discoverySplash)) : null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get the guild's splash with the given format and size
|
|
53
|
+
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
|
|
54
|
+
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
|
|
55
|
+
* @returns {String?}
|
|
56
|
+
*/
|
|
57
|
+
dynamicDiscoverySplashURL(format, size) {
|
|
58
|
+
return this.discoverySplash ? this._client._formatImage(Endpoints.GUILD_DISCOVERY_SPLASH(this.id, this.discoverySplash), format, size) : null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Get the guild's icon with the given format and size
|
|
63
|
+
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
|
|
64
|
+
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
|
|
65
|
+
* @returns {String?}
|
|
66
|
+
*/
|
|
67
|
+
dynamicIconURL(format, size) {
|
|
68
|
+
return this.icon ? this._client._formatImage(Endpoints.GUILD_ICON(this.id, this.icon), format, size) : null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get the guild's splash with the given format and size
|
|
73
|
+
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
|
|
74
|
+
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
|
|
75
|
+
* @returns {String?}
|
|
76
|
+
*/
|
|
77
|
+
dynamicSplashURL(format, size) {
|
|
78
|
+
return this.splash ? this._client._formatImage(Endpoints.GUILD_SPLASH(this.id, this.splash), format, size) : null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
toJSON(props = []) {
|
|
82
|
+
return super.toJSON([
|
|
83
|
+
"approximateMemberCount",
|
|
84
|
+
"approximatePresenceCount",
|
|
85
|
+
"description",
|
|
86
|
+
"discoverySplash",
|
|
87
|
+
"emojis",
|
|
88
|
+
"features",
|
|
89
|
+
"icon",
|
|
90
|
+
"name",
|
|
91
|
+
"splash",
|
|
92
|
+
...props,
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
module.exports = GuildPreview;
|