oceanic.js 1.10.3-dev.c6c9f52 → 1.10.3-dev.ca8b6e8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/Client.d.ts +99 -0
- package/dist/lib/Client.js +263 -0
- package/dist/lib/Constants.d.ts +1215 -0
- package/dist/lib/Constants.js +1513 -0
- package/dist/lib/gateway/Shard.d.ts +83 -0
- package/dist/lib/gateway/Shard.js +1621 -0
- package/dist/lib/gateway/ShardManager.d.ts +29 -0
- package/dist/lib/gateway/ShardManager.js +300 -0
- package/dist/lib/index.d.ts +84 -0
- package/dist/lib/index.js +168 -0
- package/dist/lib/rest/Bucket.d.ts +33 -0
- package/dist/lib/rest/Bucket.js +78 -0
- package/dist/lib/rest/DiscordHTTPError.d.ts +16 -0
- package/dist/lib/rest/DiscordHTTPError.js +65 -0
- package/dist/lib/rest/DiscordRESTError.d.ts +19 -0
- package/dist/lib/rest/DiscordRESTError.js +89 -0
- package/dist/lib/rest/OAuthHelper.d.ts +62 -0
- package/dist/lib/rest/OAuthHelper.js +183 -0
- package/dist/lib/rest/RESTManager.d.ts +42 -0
- package/dist/lib/rest/RESTManager.js +82 -0
- package/dist/lib/rest/RequestHandler.d.ts +28 -0
- package/dist/lib/rest/RequestHandler.js +313 -0
- package/dist/lib/rest/SequentialBucket.d.ts +25 -0
- package/dist/lib/rest/SequentialBucket.js +76 -0
- package/dist/lib/routes/Applications.d.ts +171 -0
- package/dist/lib/routes/Applications.js +447 -0
- package/dist/lib/routes/Channels.d.ts +408 -0
- package/dist/lib/routes/Channels.js +1160 -0
- package/dist/lib/routes/Guilds.d.ts +606 -0
- package/dist/lib/routes/Guilds.js +1669 -0
- package/dist/lib/routes/Interactions.d.ts +74 -0
- package/dist/lib/routes/Interactions.js +141 -0
- package/dist/lib/routes/Miscellaneous.d.ts +31 -0
- package/dist/lib/routes/Miscellaneous.js +69 -0
- package/dist/lib/routes/OAuth.d.ts +108 -0
- package/dist/lib/routes/OAuth.js +312 -0
- package/dist/lib/routes/Users.d.ts +32 -0
- package/dist/lib/routes/Users.js +59 -0
- package/dist/lib/routes/Webhooks.d.ts +128 -0
- package/dist/lib/routes/Webhooks.js +265 -0
- package/dist/lib/structures/AnnouncementChannel.d.ts +36 -0
- package/dist/lib/structures/AnnouncementChannel.js +47 -0
- package/dist/lib/structures/AnnouncementThreadChannel.d.ts +18 -0
- package/dist/lib/structures/AnnouncementThreadChannel.js +27 -0
- package/dist/lib/structures/Application.d.ts +102 -0
- package/dist/lib/structures/Application.js +189 -0
- package/dist/lib/structures/ApplicationCommand.d.ts +74 -0
- package/dist/lib/structures/ApplicationCommand.js +141 -0
- package/dist/lib/structures/Attachment.d.ts +34 -0
- package/dist/lib/structures/Attachment.js +64 -0
- package/dist/lib/structures/AuditLogEntry.d.ts +25 -0
- package/dist/lib/structures/AuditLogEntry.js +53 -0
- package/dist/lib/structures/AutoModerationRule.d.ts +49 -0
- package/dist/lib/structures/AutoModerationRule.js +139 -0
- package/dist/lib/structures/AutocompleteInteraction.d.ts +62 -0
- package/dist/lib/structures/AutocompleteInteraction.js +115 -0
- package/dist/lib/structures/Base.d.ts +20 -0
- package/dist/lib/structures/Base.js +58 -0
- package/dist/lib/structures/BaseEntitlement.d.ts +19 -0
- package/dist/lib/structures/BaseEntitlement.js +44 -0
- package/dist/lib/structures/CategoryChannel.d.ts +41 -0
- package/dist/lib/structures/CategoryChannel.js +105 -0
- package/dist/lib/structures/Channel.d.ts +20 -0
- package/dist/lib/structures/Channel.js +91 -0
- package/dist/lib/structures/ClientApplication.d.ts +153 -0
- package/dist/lib/structures/ClientApplication.js +220 -0
- package/dist/lib/structures/CommandInteraction.d.ts +127 -0
- package/dist/lib/structures/CommandInteraction.js +297 -0
- package/dist/lib/structures/ComponentInteraction.d.ts +137 -0
- package/dist/lib/structures/ComponentInteraction.js +311 -0
- package/dist/lib/structures/Entitlement.d.ts +12 -0
- package/dist/lib/structures/Entitlement.js +26 -0
- package/dist/lib/structures/ExtendedUser.d.ts +26 -0
- package/dist/lib/structures/ExtendedUser.js +57 -0
- package/dist/lib/structures/ForumChannel.d.ts +11 -0
- package/dist/lib/structures/ForumChannel.js +19 -0
- package/dist/lib/structures/GroupChannel.d.ts +62 -0
- package/dist/lib/structures/GroupChannel.js +133 -0
- package/dist/lib/structures/Guild.d.ts +654 -0
- package/dist/lib/structures/Guild.js +1319 -0
- package/dist/lib/structures/GuildChannel.d.ts +34 -0
- package/dist/lib/structures/GuildChannel.js +75 -0
- package/dist/lib/structures/GuildPreview.d.ts +50 -0
- package/dist/lib/structures/GuildPreview.js +119 -0
- package/dist/lib/structures/GuildScheduledEvent.d.ts +60 -0
- package/dist/lib/structures/GuildScheduledEvent.js +154 -0
- package/dist/lib/structures/GuildTemplate.d.ts +55 -0
- package/dist/lib/structures/GuildTemplate.js +126 -0
- package/dist/lib/structures/Integration.d.ts +54 -0
- package/dist/lib/structures/Integration.js +156 -0
- package/dist/lib/structures/Interaction.d.ts +40 -0
- package/dist/lib/structures/Interaction.js +90 -0
- package/dist/lib/structures/InteractionResolvedChannel.d.ts +28 -0
- package/dist/lib/structures/InteractionResolvedChannel.js +45 -0
- package/dist/lib/structures/Invite.d.ts +64 -0
- package/dist/lib/structures/Invite.js +193 -0
- package/dist/lib/structures/InviteGuild.d.ts +52 -0
- package/dist/lib/structures/InviteGuild.js +88 -0
- package/dist/lib/structures/MediaChannel.d.ts +11 -0
- package/dist/lib/structures/MediaChannel.js +19 -0
- package/dist/lib/structures/Member.d.ts +122 -0
- package/dist/lib/structures/Member.js +255 -0
- package/dist/lib/structures/Message.d.ts +194 -0
- package/dist/lib/structures/Message.js +477 -0
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +128 -0
- package/dist/lib/structures/ModalSubmitInteraction.js +240 -0
- package/dist/lib/structures/OAuthApplication.d.ts +79 -0
- package/dist/lib/structures/OAuthApplication.js +210 -0
- package/dist/lib/structures/OAuthGuild.d.ts +35 -0
- package/dist/lib/structures/OAuthGuild.js +61 -0
- package/dist/lib/structures/PartialApplication.d.ts +30 -0
- package/dist/lib/structures/PartialApplication.js +67 -0
- package/dist/lib/structures/Permission.d.ts +21 -0
- package/dist/lib/structures/Permission.js +68 -0
- package/dist/lib/structures/PermissionOverwrite.d.ts +26 -0
- package/dist/lib/structures/PermissionOverwrite.js +49 -0
- package/dist/lib/structures/PingInteraction.d.ts +16 -0
- package/dist/lib/structures/PingInteraction.js +26 -0
- package/dist/lib/structures/Poll.d.ts +28 -0
- package/dist/lib/structures/Poll.js +78 -0
- package/dist/lib/structures/PrivateChannel.d.ts +90 -0
- package/dist/lib/structures/PrivateChannel.js +131 -0
- package/dist/lib/structures/PrivateThreadChannel.d.ts +18 -0
- package/dist/lib/structures/PrivateThreadChannel.js +27 -0
- package/dist/lib/structures/PublicThreadChannel.d.ts +21 -0
- package/dist/lib/structures/PublicThreadChannel.js +37 -0
- package/dist/lib/structures/Role.d.ts +52 -0
- package/dist/lib/structures/Role.js +137 -0
- package/dist/lib/structures/SKU.d.ts +32 -0
- package/dist/lib/structures/SKU.js +53 -0
- package/dist/lib/structures/StageChannel.d.ts +33 -0
- package/dist/lib/structures/StageChannel.js +44 -0
- package/dist/lib/structures/StageInstance.d.ts +36 -0
- package/dist/lib/structures/StageInstance.js +94 -0
- package/dist/lib/structures/Team.d.ts +22 -0
- package/dist/lib/structures/Team.js +67 -0
- package/dist/lib/structures/TestEntitlement.d.ts +10 -0
- package/dist/lib/structures/TestEntitlement.js +21 -0
- package/dist/lib/structures/TextChannel.d.ts +34 -0
- package/dist/lib/structures/TextChannel.js +46 -0
- package/dist/lib/structures/TextableChannel.d.ts +158 -0
- package/dist/lib/structures/TextableChannel.js +276 -0
- package/dist/lib/structures/TextableVoiceChannel.d.ts +39 -0
- package/dist/lib/structures/TextableVoiceChannel.js +81 -0
- package/dist/lib/structures/ThreadChannel.d.ts +159 -0
- package/dist/lib/structures/ThreadChannel.js +295 -0
- package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
- package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
- package/dist/lib/structures/ThreadableChannel.d.ts +36 -0
- package/dist/lib/structures/ThreadableChannel.js +58 -0
- package/dist/lib/structures/UnavailableGuild.d.ts +11 -0
- package/dist/lib/structures/UnavailableGuild.js +21 -0
- package/dist/lib/structures/User.d.ts +82 -0
- package/dist/lib/structures/User.js +168 -0
- package/dist/lib/structures/VoiceChannel.d.ts +20 -0
- package/dist/lib/structures/VoiceChannel.js +35 -0
- package/dist/lib/structures/VoiceState.d.ts +51 -0
- package/dist/lib/structures/VoiceState.js +140 -0
- package/dist/lib/structures/Webhook.d.ts +129 -0
- package/dist/lib/structures/Webhook.js +206 -0
- package/dist/lib/types/applications.d.ts +466 -0
- package/dist/lib/types/audit-log.d.ts +122 -0
- package/dist/lib/types/auto-moderation.d.ts +99 -0
- package/dist/lib/types/channels.d.ts +1244 -0
- package/dist/lib/types/client.d.ts +228 -0
- package/dist/lib/types/events.d.ts +265 -0
- package/dist/lib/types/gateway-raw.d.ts +584 -0
- package/dist/lib/types/gateway.d.ts +351 -0
- package/dist/lib/types/guild-template.d.ts +33 -0
- package/dist/lib/types/guilds.d.ts +855 -0
- package/dist/lib/types/index.d.ts +18 -0
- package/dist/lib/types/interactions.d.ts +377 -0
- package/dist/lib/types/json.d.ts +742 -0
- package/dist/lib/types/misc.d.ts +28 -0
- package/dist/lib/types/oauth.d.ts +201 -0
- package/dist/lib/types/request-handler.d.ts +52 -0
- package/dist/lib/types/scheduled-events.d.ts +88 -0
- package/dist/lib/types/shared.d.ts +9 -0
- package/dist/lib/types/users.d.ts +45 -0
- package/dist/lib/types/voice.d.ts +45 -0
- package/dist/lib/types/webhooks.d.ts +74 -0
- package/dist/lib/util/Collection.d.ts +47 -0
- package/dist/lib/util/Collection.js +78 -0
- package/dist/lib/util/Errors.d.ts +29 -0
- package/dist/lib/util/Errors.js +56 -0
- package/dist/lib/util/Routes.d.ts +127 -0
- package/dist/lib/util/Routes.js +248 -0
- package/dist/lib/util/SimpleCollection.d.ts +12 -0
- package/dist/lib/util/SimpleCollection.js +81 -0
- package/dist/lib/util/TypedCollection.d.ts +24 -0
- package/dist/lib/util/TypedCollection.js +76 -0
- package/dist/lib/util/TypedEmitter.d.ts +19 -0
- package/dist/lib/util/TypedEmitter.js +19 -0
- package/dist/lib/util/Util.d.ts +58 -0
- package/dist/lib/util/Util.js +535 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.js +213 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +24 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.js +28 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +24 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +34 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +60 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +124 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/** @module Invite */
|
|
5
|
+
const Channel_1 = tslib_1.__importDefault(require("./Channel"));
|
|
6
|
+
const PartialApplication_1 = tslib_1.__importDefault(require("./PartialApplication"));
|
|
7
|
+
const InviteGuild_1 = tslib_1.__importDefault(require("./InviteGuild"));
|
|
8
|
+
/** Represents an invite. */
|
|
9
|
+
class Invite {
|
|
10
|
+
_cachedChannel;
|
|
11
|
+
/** The approximate number of total members in the guild this invite leads to. */
|
|
12
|
+
approximateMemberCount;
|
|
13
|
+
/** The approximate number of online members in the guild this invite leads to. */
|
|
14
|
+
approximatePresenceCount;
|
|
15
|
+
/** The ID of the channel this invite leads to. */
|
|
16
|
+
channelID;
|
|
17
|
+
client;
|
|
18
|
+
/** The code of this invite. */
|
|
19
|
+
code;
|
|
20
|
+
/** When this invite was created. */
|
|
21
|
+
createdAt;
|
|
22
|
+
/** The date at which this invite expires. */
|
|
23
|
+
expiresAt;
|
|
24
|
+
/** This invite's [flags](https://discord.com/developers/docs/resources/invite#invite-object-invite-flags). */
|
|
25
|
+
flags;
|
|
26
|
+
/** The guild this invite leads to or `null` if this invite leads to a Group DM. */
|
|
27
|
+
guild;
|
|
28
|
+
/** The ID of the guild this invite leads to or `null` if this invite leads to a Group DM. */
|
|
29
|
+
guildID;
|
|
30
|
+
/** The scheduled event associated with this invite. */
|
|
31
|
+
guildScheduledEvent;
|
|
32
|
+
/** The user that created this invite. */
|
|
33
|
+
inviter;
|
|
34
|
+
/** The time after which this invite expires. */
|
|
35
|
+
maxAge;
|
|
36
|
+
/** The maximum number of times this invite can be used, */
|
|
37
|
+
maxUses;
|
|
38
|
+
/** @deprecated The stage instance in the invite this channel is for. */
|
|
39
|
+
stageInstance;
|
|
40
|
+
/** The embedded application this invite will open. */
|
|
41
|
+
targetApplication;
|
|
42
|
+
/** The [target type](https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types) of this invite. */
|
|
43
|
+
targetType;
|
|
44
|
+
/** The user whose stream to display for this voice channel stream invite. */
|
|
45
|
+
targetUser;
|
|
46
|
+
/** If this invite only grants temporary membership. */
|
|
47
|
+
temporary;
|
|
48
|
+
/** The number of times this invite has been used. */
|
|
49
|
+
uses;
|
|
50
|
+
constructor(data, client) {
|
|
51
|
+
Object.defineProperty(this, "client", {
|
|
52
|
+
value: client,
|
|
53
|
+
enumerable: false,
|
|
54
|
+
writable: false,
|
|
55
|
+
configurable: false
|
|
56
|
+
});
|
|
57
|
+
this.channelID = (data.channel_id ?? data.channel?.id) ?? null;
|
|
58
|
+
this.code = data.code;
|
|
59
|
+
this.flags = data.flags ?? 0;
|
|
60
|
+
this.guild = null;
|
|
61
|
+
this.guildID = data.guild?.id ?? null;
|
|
62
|
+
this.expiresAt = (data.expires_at ? new Date(data.expires_at) : undefined);
|
|
63
|
+
this.targetType = data.target_type;
|
|
64
|
+
this.update(data);
|
|
65
|
+
}
|
|
66
|
+
update(data) {
|
|
67
|
+
if (data.approximate_member_count !== undefined) {
|
|
68
|
+
this.approximateMemberCount = data.approximate_member_count;
|
|
69
|
+
}
|
|
70
|
+
if (data.approximate_presence_count !== undefined) {
|
|
71
|
+
this.approximatePresenceCount = data.approximate_presence_count;
|
|
72
|
+
}
|
|
73
|
+
if (data.flags !== undefined) {
|
|
74
|
+
this.flags = data.flags;
|
|
75
|
+
}
|
|
76
|
+
let guild;
|
|
77
|
+
if (data.guild) {
|
|
78
|
+
if (this.guild === null) {
|
|
79
|
+
this.guild = new InviteGuild_1.default(data.guild, this.client);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.guild["update"](data.guild);
|
|
83
|
+
}
|
|
84
|
+
if (this.client.guilds.has(data.guild.id)) {
|
|
85
|
+
this.client.guilds.update(data.guild);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (this.channelID === null) {
|
|
89
|
+
this._cachedChannel = null;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
let channel;
|
|
93
|
+
channel = this.client.getChannel(this.channelID);
|
|
94
|
+
if (data.channel !== undefined) {
|
|
95
|
+
if (channel && channel instanceof Channel_1.default) {
|
|
96
|
+
channel["update"](data.channel);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
channel = data.channel;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
this._cachedChannel = channel;
|
|
103
|
+
}
|
|
104
|
+
if (data.inviter !== undefined) {
|
|
105
|
+
this.inviter = this.client.users.update(data.inviter);
|
|
106
|
+
}
|
|
107
|
+
if (data.stage_instance !== undefined) {
|
|
108
|
+
this.stageInstance = {
|
|
109
|
+
members: data.stage_instance.members.map(member => this.client.util.updateMember(guild.id, member.user.id, member)),
|
|
110
|
+
participantCount: data.stage_instance.participant_count,
|
|
111
|
+
speakerCount: data.stage_instance.speaker_count,
|
|
112
|
+
topic: data.stage_instance.topic
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (data.target_application !== undefined) {
|
|
116
|
+
this.targetApplication = new PartialApplication_1.default(data.target_application, this.client);
|
|
117
|
+
}
|
|
118
|
+
if (data.guild_scheduled_event !== undefined) {
|
|
119
|
+
this.guildScheduledEvent = guild.scheduledEvents.update(data.guild_scheduled_event);
|
|
120
|
+
}
|
|
121
|
+
if (data.target_user !== undefined) {
|
|
122
|
+
this.targetUser = this.client.users.update(data.target_user);
|
|
123
|
+
}
|
|
124
|
+
if ("created_at" in data) {
|
|
125
|
+
if (data.created_at !== undefined) {
|
|
126
|
+
this.createdAt = new Date(data.created_at);
|
|
127
|
+
}
|
|
128
|
+
if (data.uses !== undefined) {
|
|
129
|
+
this.uses = data.uses;
|
|
130
|
+
}
|
|
131
|
+
if (data.max_uses !== undefined) {
|
|
132
|
+
this.maxUses = data.max_uses;
|
|
133
|
+
}
|
|
134
|
+
if (data.max_age !== undefined) {
|
|
135
|
+
this.maxAge = data.max_age;
|
|
136
|
+
}
|
|
137
|
+
if (data.temporary !== undefined) {
|
|
138
|
+
this.temporary = data.temporary;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/** The channel this invite leads to. If the channel is not cached, this will be a partial with only `id`, `name, and `type`. */
|
|
143
|
+
get channel() {
|
|
144
|
+
if (this.channelID !== null) {
|
|
145
|
+
if (this._cachedChannel instanceof Channel_1.default) {
|
|
146
|
+
return this._cachedChannel;
|
|
147
|
+
}
|
|
148
|
+
const cachedChannel = this.client.getChannel(this.channelID);
|
|
149
|
+
return cachedChannel ? (this._cachedChannel = cachedChannel) : this._cachedChannel;
|
|
150
|
+
}
|
|
151
|
+
return this._cachedChannel === null ? this._cachedChannel : (this._cachedChannel = null);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Delete this invite.
|
|
155
|
+
* @param reason The reason for deleting this invite.
|
|
156
|
+
*/
|
|
157
|
+
async deleteInvite(reason) {
|
|
158
|
+
return this.client.rest.channels.deleteInvite(this.code, reason);
|
|
159
|
+
}
|
|
160
|
+
/** Whether this invite belongs to a cached channel. The only difference on using this method over a simple if statement is to easily update all the invite properties typing definitions based on the channel it belongs to. */
|
|
161
|
+
inCachedChannel() {
|
|
162
|
+
return this.channel instanceof Channel_1.default;
|
|
163
|
+
}
|
|
164
|
+
toJSON() {
|
|
165
|
+
return {
|
|
166
|
+
approximateMemberCount: this.approximateMemberCount,
|
|
167
|
+
approximatePresenceCount: this.approximatePresenceCount,
|
|
168
|
+
channelID: this.channelID ?? undefined,
|
|
169
|
+
code: this.code,
|
|
170
|
+
createdAt: this.createdAt?.getTime(),
|
|
171
|
+
expiresAt: this.expiresAt?.getTime(),
|
|
172
|
+
guild: this.guild?.toJSON(),
|
|
173
|
+
guildID: this.guildID ?? undefined,
|
|
174
|
+
guildScheduledEvent: this.guildScheduledEvent?.toJSON(),
|
|
175
|
+
inviter: this.inviter?.id,
|
|
176
|
+
maxAge: this.maxAge,
|
|
177
|
+
maxUses: this.maxUses,
|
|
178
|
+
stageInstance: this.stageInstance ? {
|
|
179
|
+
members: this.stageInstance.members.map(member => member.id),
|
|
180
|
+
participantCount: this.stageInstance.participantCount,
|
|
181
|
+
speakerCount: this.stageInstance.speakerCount,
|
|
182
|
+
topic: this.stageInstance.topic
|
|
183
|
+
} : undefined,
|
|
184
|
+
targetApplication: this.targetApplication?.toJSON(),
|
|
185
|
+
targetType: this.targetType,
|
|
186
|
+
targetUser: this.targetUser?.id,
|
|
187
|
+
temporary: this.temporary,
|
|
188
|
+
uses: this.uses
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.default = Invite;
|
|
193
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW52aXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi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QWEsRUFBYSxJQUFJLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQztnQkFDM0MsT0FBTyxFQUFXLElBQUksQ0FBQyxhQUFhLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUM7Z0JBQ3JFLGdCQUFnQixFQUFFLElBQUksQ0FBQyxhQUFhLENBQUMsZ0JBQWdCO2dCQUNyRCxZQUFZLEVBQU0sSUFBSSxDQUFDLGFBQWEsQ0FBQyxZQUFZO2dCQUNqRCxLQUFLLEVBQWEsSUFBSSxDQUFDLGFBQWEsQ0FBQyxLQUFLO2FBQzdDLENBQUMsQ0FBQyxDQUFDLFNBQVM7WUFDYixpQkFBaUIsRUFBRSxJQUFJLENBQUMsaUJBQWlCLEVBQUUsTUFBTSxFQUFFO1lBQ25ELFVBQVUsRUFBUyxJQUFJLENBQUMsVUFBVTtZQUNsQyxVQUFVLEVBQVMsSUFBSSxDQUFDLFVBQVUsRUFBRSxFQUFFO1lBQ3RDLFNBQVMsRUFBVSxJQUFJLENBQUMsU0FBUztZQUNqQyxJQUFJLEVBQWUsSUFBSSxDQUFDLElBQUk7U0FDL0IsQ0FBQztJQUNOLENBQUM7Q0FDSjtBQS9MRCx5QkErTEMifQ==
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** @module InviteGuild */
|
|
2
|
+
import Base from "./Base";
|
|
3
|
+
import type Guild from "./Guild";
|
|
4
|
+
import type { GuildFeature, GuildNSFWLevels, ImageFormat, VerificationLevels } from "../Constants";
|
|
5
|
+
import type { JSONInviteGuild, RawInviteGuild } from "../types";
|
|
6
|
+
import type Client from "../Client";
|
|
7
|
+
/** Represents a guild received via an invite. */
|
|
8
|
+
export default class InviteGuild extends Base {
|
|
9
|
+
private _cachedCompleteGuild?;
|
|
10
|
+
/** The hash of this guild's banner. */
|
|
11
|
+
banner: string | null;
|
|
12
|
+
/** The description of this guild. */
|
|
13
|
+
description: string | null;
|
|
14
|
+
/** The [features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) this guild has. */
|
|
15
|
+
features: Array<GuildFeature>;
|
|
16
|
+
/** The icon hash of this guild. */
|
|
17
|
+
icon: string | null;
|
|
18
|
+
/** The name of this guild. */
|
|
19
|
+
name: string;
|
|
20
|
+
/** The [nsfw level](https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level) of this guild. */
|
|
21
|
+
nsfwLevel: GuildNSFWLevels;
|
|
22
|
+
/** The number of nitro boosts this guild has. */
|
|
23
|
+
premiumSubscriptionCount?: number;
|
|
24
|
+
/** The invite splash hash of this guild. */
|
|
25
|
+
splash: string | null;
|
|
26
|
+
/** The vanity url of this guild. Only present in guilds with the `VANITY_URL` feature. */
|
|
27
|
+
vanityURLCode: string | null;
|
|
28
|
+
/** The [verification level](https://discord.com/developers/docs/resources/guild#guild-object-verification-level) of this guild. */
|
|
29
|
+
verificationLevel: VerificationLevels;
|
|
30
|
+
constructor(data: RawInviteGuild, client: Client);
|
|
31
|
+
/** The complete guild this InviteGuild represents, if cached. */
|
|
32
|
+
get completeGuild(): Guild | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The url of this guild's banner.
|
|
35
|
+
* @param format The format the url should be.
|
|
36
|
+
* @param size The dimensions of the image.
|
|
37
|
+
*/
|
|
38
|
+
bannerURL(format?: ImageFormat, size?: number): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The url of this guild's icon.
|
|
41
|
+
* @param format The format the url should be.
|
|
42
|
+
* @param size The dimensions of the image.
|
|
43
|
+
*/
|
|
44
|
+
iconURL(format?: ImageFormat, size?: number): string | null;
|
|
45
|
+
/**
|
|
46
|
+
* The url of this guild's invite splash.
|
|
47
|
+
* @param format The format the url should be.
|
|
48
|
+
* @param size The dimensions of the image.
|
|
49
|
+
*/
|
|
50
|
+
splashURL(format?: ImageFormat, size?: number): string | null;
|
|
51
|
+
toJSON(): JSONInviteGuild;
|
|
52
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/** @module InviteGuild */
|
|
5
|
+
const Base_1 = tslib_1.__importDefault(require("./Base"));
|
|
6
|
+
const Routes = tslib_1.__importStar(require("../util/Routes"));
|
|
7
|
+
/** Represents a guild received via an invite. */
|
|
8
|
+
class InviteGuild extends Base_1.default {
|
|
9
|
+
_cachedCompleteGuild;
|
|
10
|
+
/** The hash of this guild's banner. */
|
|
11
|
+
banner;
|
|
12
|
+
/** The description of this guild. */
|
|
13
|
+
description;
|
|
14
|
+
/** The [features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) this guild has. */
|
|
15
|
+
features;
|
|
16
|
+
/** The icon hash of this guild. */
|
|
17
|
+
icon;
|
|
18
|
+
/** The name of this guild. */
|
|
19
|
+
name;
|
|
20
|
+
/** The [nsfw level](https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level) of this guild. */
|
|
21
|
+
nsfwLevel;
|
|
22
|
+
/** The number of nitro boosts this guild has. */
|
|
23
|
+
premiumSubscriptionCount;
|
|
24
|
+
/** The invite splash hash of this guild. */
|
|
25
|
+
splash;
|
|
26
|
+
/** The vanity url of this guild. Only present in guilds with the `VANITY_URL` feature. */
|
|
27
|
+
vanityURLCode;
|
|
28
|
+
/** The [verification level](https://discord.com/developers/docs/resources/guild#guild-object-verification-level) of this guild. */
|
|
29
|
+
verificationLevel;
|
|
30
|
+
constructor(data, client) {
|
|
31
|
+
super(data.id, client);
|
|
32
|
+
this.banner = data.banner;
|
|
33
|
+
this.description = data.description;
|
|
34
|
+
this.features = data.features;
|
|
35
|
+
this.name = data.name;
|
|
36
|
+
this.nsfwLevel = data.nsfw_level;
|
|
37
|
+
this.icon = data.icon;
|
|
38
|
+
this.premiumSubscriptionCount = data.premium_subscription_count;
|
|
39
|
+
this.splash = data.splash;
|
|
40
|
+
this.vanityURLCode = data.vanity_url_code;
|
|
41
|
+
this.verificationLevel = data.verification_level;
|
|
42
|
+
}
|
|
43
|
+
/** The complete guild this InviteGuild represents, if cached. */
|
|
44
|
+
get completeGuild() {
|
|
45
|
+
return this._cachedCompleteGuild ??= this.client.guilds.get(this.id);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The url of this guild's banner.
|
|
49
|
+
* @param format The format the url should be.
|
|
50
|
+
* @param size The dimensions of the image.
|
|
51
|
+
*/
|
|
52
|
+
bannerURL(format, size) {
|
|
53
|
+
return this.banner === null ? null : this.client.util.formatImage(Routes.BANNER(this.id, this.banner), format, size);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The url of this guild's icon.
|
|
57
|
+
* @param format The format the url should be.
|
|
58
|
+
* @param size The dimensions of the image.
|
|
59
|
+
*/
|
|
60
|
+
iconURL(format, size) {
|
|
61
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.GUILD_ICON(this.id, this.icon), format, size);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The url of this guild's invite splash.
|
|
65
|
+
* @param format The format the url should be.
|
|
66
|
+
* @param size The dimensions of the image.
|
|
67
|
+
*/
|
|
68
|
+
splashURL(format, size) {
|
|
69
|
+
return this.splash === null ? null : this.client.util.formatImage(Routes.GUILD_SPLASH(this.id, this.splash), format, size);
|
|
70
|
+
}
|
|
71
|
+
toJSON() {
|
|
72
|
+
return {
|
|
73
|
+
...super.toJSON(),
|
|
74
|
+
banner: this.banner,
|
|
75
|
+
description: this.description,
|
|
76
|
+
features: this.features,
|
|
77
|
+
icon: this.icon,
|
|
78
|
+
name: this.name,
|
|
79
|
+
nsfwLevel: this.nsfwLevel,
|
|
80
|
+
premiumSubscriptionCount: this.premiumSubscriptionCount,
|
|
81
|
+
splash: this.splash,
|
|
82
|
+
vanityURLCode: this.vanityURLCode,
|
|
83
|
+
verificationLevel: this.verificationLevel
|
|
84
|
+
};
|
|
85
|
+
}
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ElBQUksQ0FBQyxhQUFhO1lBQzVDLGlCQUFpQixFQUFTLElBQUksQ0FBQyxpQkFBaUI7U0FDbkQsQ0FBQztJQUNOLENBQUM7Q0FDSjtBQW5GRCw4QkFtRkMifQ==
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @module MediaChannel */
|
|
2
|
+
import ThreadOnlyChannel from "./ThreadOnlyChannel";
|
|
3
|
+
import type Client from "../Client";
|
|
4
|
+
import type { ChannelTypes } from "../Constants";
|
|
5
|
+
import type { JSONMediaChannel, RawMediaChannel } from "../types";
|
|
6
|
+
/** Represents a media channel. */
|
|
7
|
+
export default class MediaChannel extends ThreadOnlyChannel {
|
|
8
|
+
type: ChannelTypes.GUILD_MEDIA;
|
|
9
|
+
constructor(data: RawMediaChannel, client: Client);
|
|
10
|
+
toJSON(): JSONMediaChannel;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/** @module MediaChannel */
|
|
5
|
+
const ThreadOnlyChannel_1 = tslib_1.__importDefault(require("./ThreadOnlyChannel"));
|
|
6
|
+
/** Represents a media channel. */
|
|
7
|
+
class MediaChannel extends ThreadOnlyChannel_1.default {
|
|
8
|
+
constructor(data, client) {
|
|
9
|
+
super(data, client);
|
|
10
|
+
}
|
|
11
|
+
toJSON() {
|
|
12
|
+
return {
|
|
13
|
+
...super.toJSON(),
|
|
14
|
+
type: this.type
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = MediaChannel;
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWVkaWFDaGFubmVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3N0cnVjdHVyZXMvTWVkaWFDaGFubmVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDJCQUEyQjtBQUMzQixvRkFBb0Q7QUFLcEQsa0NBQWtDO0FBQ2xDLE1BQXFCLFlBQWEsU0FBUSwyQkFBaUI7SUFFdkQsWUFBWSxJQUFxQixFQUFFLE1BQWM7UUFDN0MsS0FBSyxDQUFDLElBQUksRUFBRSxNQUFNLENBQUMsQ0FBQztJQUN4QixDQUFDO0lBRVEsTUFBTTtRQUNYLE9BQU87WUFDSCxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUU7WUFDakIsSUFBSSxFQUFFLElBQUksQ0FBQyxJQUFJO1NBQ2xCLENBQUM7SUFDTixDQUFDO0NBQ0o7QUFaRCwrQkFZQyJ9
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/** @module Member */
|
|
2
|
+
import Base from "./Base";
|
|
3
|
+
import type User from "./User";
|
|
4
|
+
import type Guild from "./Guild";
|
|
5
|
+
import type Permission from "./Permission";
|
|
6
|
+
import type VoiceState from "./VoiceState";
|
|
7
|
+
import { type ImageFormat } from "../Constants";
|
|
8
|
+
import type Client from "../Client";
|
|
9
|
+
import type { CreateBanOptions, EditMemberOptions, EditUserVoiceStateOptions, RawMember, RESTMember, Presence } from "../types/guilds";
|
|
10
|
+
import type { JSONMember } from "../types/json";
|
|
11
|
+
/** Represents a member of a guild. */
|
|
12
|
+
export default class Member extends Base {
|
|
13
|
+
private _cachedGuild?;
|
|
14
|
+
/** The member's avatar hash, if they have set a guild avatar. */
|
|
15
|
+
avatar: string | null;
|
|
16
|
+
/** When the member's [timeout](https://support.discord.com/hc/en-us/articles/4413305239191-Time-Out-FAQ) will expire, if active. */
|
|
17
|
+
communicationDisabledUntil: Date | null;
|
|
18
|
+
/** If this member is server deafened. */
|
|
19
|
+
deaf: boolean;
|
|
20
|
+
/** The member's [flags](https://discord.com/developers/docs/resources/guild#guild-member-object-flags). */
|
|
21
|
+
flags: number;
|
|
22
|
+
/** The id of the guild this member is for. */
|
|
23
|
+
guildID: string;
|
|
24
|
+
/** Undocumented. */
|
|
25
|
+
isPending?: boolean;
|
|
26
|
+
/** The date at which this member joined the guild. */
|
|
27
|
+
joinedAt: Date | null;
|
|
28
|
+
/** If this member is server muted. */
|
|
29
|
+
mute: boolean;
|
|
30
|
+
/** This member's nickname, if any. */
|
|
31
|
+
nick: string | null;
|
|
32
|
+
/** If this member has not passed the guild's [membership screening](https://discord.com/developers/docs/resources/guild#membership-screening-object) requirements. */
|
|
33
|
+
pending: boolean;
|
|
34
|
+
/** The date at which this member started boosting the guild, if applicable. */
|
|
35
|
+
premiumSince: Date | null;
|
|
36
|
+
/** The presence of this member. */
|
|
37
|
+
presence?: Presence;
|
|
38
|
+
/** The roles this member has. */
|
|
39
|
+
roles: Array<string>;
|
|
40
|
+
/** The user associated with this member. */
|
|
41
|
+
user: User;
|
|
42
|
+
constructor(data: (RawMember | RESTMember) & {
|
|
43
|
+
id?: string;
|
|
44
|
+
}, client: Client, guildID: string);
|
|
45
|
+
private toggleFlag;
|
|
46
|
+
protected update(data: Partial<RawMember | RESTMember>): void;
|
|
47
|
+
/** If the member associated with the user is a bot. */
|
|
48
|
+
get bot(): boolean;
|
|
49
|
+
/** The Discord-tag of the user associated with this member. */
|
|
50
|
+
get discriminator(): string;
|
|
51
|
+
/** The nick of this member if set, the display name of this member's user if set, or their username. */
|
|
52
|
+
get displayName(): string;
|
|
53
|
+
/** The guild this member is for. This will throw an error if the guild is not cached. */
|
|
54
|
+
get guild(): Guild;
|
|
55
|
+
/** A string that will mention this member. */
|
|
56
|
+
get mention(): string;
|
|
57
|
+
/** The permissions of this member. */
|
|
58
|
+
get permissions(): Permission;
|
|
59
|
+
/** The user associated with this member's public [flags](https://discord.com/developers/docs/resources/user#user-object-user-flags). */
|
|
60
|
+
get publicFlags(): number;
|
|
61
|
+
/** If this user associated with this member is an official discord system user. */
|
|
62
|
+
get system(): boolean;
|
|
63
|
+
/** The 4 digits after this user's username, if they have not been migrated. If migrated, this will be a single "0". */
|
|
64
|
+
get tag(): string;
|
|
65
|
+
/** The username associated with this member's user. */
|
|
66
|
+
get username(): string;
|
|
67
|
+
/** The voice state of this member. */
|
|
68
|
+
get voiceState(): VoiceState | null;
|
|
69
|
+
/**
|
|
70
|
+
* Add a role to this member.
|
|
71
|
+
* @param roleID The ID of the role to add.
|
|
72
|
+
*/
|
|
73
|
+
addRole(roleID: string, reason?: string): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* The url of this user's guild avatar (or their user avatar if no guild avatar is set, or their default avatar if none apply).
|
|
76
|
+
* @param format The format the url should be.
|
|
77
|
+
* @param size The dimensions of the image.
|
|
78
|
+
*/
|
|
79
|
+
avatarURL(format?: ImageFormat, size?: number): string;
|
|
80
|
+
/**
|
|
81
|
+
* Create a ban for this member.
|
|
82
|
+
* @param options The options for the ban.
|
|
83
|
+
*/
|
|
84
|
+
ban(options?: CreateBanOptions): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Disable the `BYPASSES_VERIFICATION` flag for this member. Requires the **Manage Guild** permission.
|
|
87
|
+
* @param reason The reason for disabling the flag.
|
|
88
|
+
*/
|
|
89
|
+
disableVerificationBypass(reason?: string): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Edit this member. Use {@link Guild#editCurrentMember | Guild#editCurrentMember} if you wish to update the nick of this client using the `CHANGE_NICKNAME` permission.
|
|
92
|
+
* @param options The options for editing the member.
|
|
93
|
+
*/
|
|
94
|
+
edit(options: EditMemberOptions): Promise<Member>;
|
|
95
|
+
/**
|
|
96
|
+
* Edit this guild member's voice state. `channelID` is required, and the user must already be in that channel. See [Discord's docs](https://discord.com/developers/docs/resources/guild#modify-user-voice-state) for more information.
|
|
97
|
+
* @param options The options for editing the voice state.
|
|
98
|
+
*/
|
|
99
|
+
editVoiceState(options: EditUserVoiceStateOptions): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Enable the `BYPASSES_VERIFICATION` flag for this member. Requires the **Manage Guild** permission.
|
|
102
|
+
* @param reason The reason for enabling the flag.
|
|
103
|
+
*/
|
|
104
|
+
enableVerificationBypass(reason?: string): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Remove a member from the guild.
|
|
107
|
+
* @param reason The reason for the kick.
|
|
108
|
+
*/
|
|
109
|
+
kick(reason?: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Remove a role from this member.
|
|
112
|
+
* @param roleID The ID of the role to remove.
|
|
113
|
+
* @param reason The reason for removing the role.
|
|
114
|
+
*/
|
|
115
|
+
removeRole(roleID: string, reason?: string): Promise<void>;
|
|
116
|
+
toJSON(): JSONMember;
|
|
117
|
+
/**
|
|
118
|
+
* Remove a ban for this member.
|
|
119
|
+
* @param reason The reason for removing the ban.
|
|
120
|
+
*/
|
|
121
|
+
unban(reason?: string): Promise<void>;
|
|
122
|
+
}
|