disgroove 2.0.1 → 2.1.0-dev.118f285
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 +16 -4
- package/dist/lib/Client.js +38 -2
- package/dist/lib/constants.d.ts +26 -2
- package/dist/lib/constants.js +29 -3
- package/dist/lib/gateway/Shard.js +6 -1
- package/dist/lib/gateway/ShardManager.js +0 -1
- package/dist/lib/gateway/index.js +0 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/rest/CDN.js +0 -1
- package/dist/lib/rest/Endpoints.d.ts +4 -1
- package/dist/lib/rest/Endpoints.js +8 -3
- package/dist/lib/rest/RequestManager.d.ts +0 -1
- package/dist/lib/rest/RequestManager.js +0 -1
- package/dist/lib/rest/index.js +0 -1
- package/dist/lib/types/application-command.d.ts +5 -1
- package/dist/lib/types/application-command.js +0 -1
- package/dist/lib/types/application-role-connection-metadata.js +0 -1
- package/dist/lib/types/application.d.ts +11 -1
- package/dist/lib/types/application.js +0 -1
- package/dist/lib/types/audit-log.js +0 -1
- package/dist/lib/types/auto-moderation.js +0 -1
- package/dist/lib/types/channel.d.ts +4 -1
- package/dist/lib/types/channel.js +0 -1
- package/dist/lib/types/emoji.js +0 -1
- package/dist/lib/types/entitlements.js +0 -1
- package/dist/lib/types/gateway-events.d.ts +28 -0
- package/dist/lib/types/gateway-events.js +0 -1
- package/dist/lib/types/guild-scheduled-event.js +0 -1
- package/dist/lib/types/guild-template.js +0 -1
- package/dist/lib/types/guild.d.ts +4 -0
- package/dist/lib/types/guild.js +0 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.js +1 -1
- package/dist/lib/types/interaction.d.ts +3 -1
- package/dist/lib/types/interaction.js +0 -1
- package/dist/lib/types/invite.js +0 -1
- package/dist/lib/types/message-components.js +0 -1
- package/dist/lib/types/poll.d.ts +66 -0
- package/dist/lib/types/poll.js +2 -0
- package/dist/lib/types/role.js +0 -1
- package/dist/lib/types/sku.js +0 -1
- package/dist/lib/types/stage-instance.js +0 -1
- package/dist/lib/types/sticker.js +0 -1
- package/dist/lib/types/team.js +0 -1
- package/dist/lib/types/user.js +0 -1
- package/dist/lib/types/voice.js +0 -1
- package/dist/lib/types/webhook.d.ts +3 -1
- package/dist/lib/types/webhook.js +0 -1
- package/dist/lib/utils/Util.js +0 -1
- package/dist/lib/utils/errors.js +0 -1
- package/dist/lib/utils/index.js +0 -1
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/lib/Client.js.map +0 -1
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/gateway/Shard.js.map +0 -1
- package/dist/lib/gateway/ShardManager.js.map +0 -1
- package/dist/lib/gateway/ShardsManager.d.ts +0 -6
- package/dist/lib/gateway/ShardsManager.js +0 -14
- package/dist/lib/gateway/ShardsManager.js.map +0 -1
- package/dist/lib/gateway/index.js.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/rest/CDN.js.map +0 -1
- package/dist/lib/rest/Endpoints.js.map +0 -1
- package/dist/lib/rest/REST.d.ts +0 -17
- package/dist/lib/rest/REST.js +0 -35
- package/dist/lib/rest/REST.js.map +0 -1
- package/dist/lib/rest/RequestManager.js.map +0 -1
- package/dist/lib/rest/RequestsManager.d.ts +0 -22
- package/dist/lib/rest/RequestsManager.js +0 -123
- package/dist/lib/rest/RequestsManager.js.map +0 -1
- package/dist/lib/rest/index.js.map +0 -1
- package/dist/lib/structures/Application.d.ts +0 -174
- package/dist/lib/structures/Application.js +0 -328
- package/dist/lib/structures/Application.js.map +0 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +0 -45
- package/dist/lib/structures/ApplicationCommand.js +0 -127
- package/dist/lib/structures/ApplicationCommand.js.map +0 -1
- package/dist/lib/structures/AuditLog.d.ts +0 -19
- package/dist/lib/structures/AuditLog.js +0 -101
- package/dist/lib/structures/AuditLog.js.map +0 -1
- package/dist/lib/structures/AutoModerationRule.d.ts +0 -34
- package/dist/lib/structures/AutoModerationRule.js +0 -96
- package/dist/lib/structures/AutoModerationRule.js.map +0 -1
- package/dist/lib/structures/Base.d.ts +0 -10
- package/dist/lib/structures/Base.js +0 -23
- package/dist/lib/structures/Base.js.map +0 -1
- package/dist/lib/structures/Channel.d.ts +0 -254
- package/dist/lib/structures/Channel.js +0 -592
- package/dist/lib/structures/Channel.js.map +0 -1
- package/dist/lib/structures/ClientApplication.d.ts +0 -150
- package/dist/lib/structures/ClientApplication.js +0 -241
- package/dist/lib/structures/ClientApplication.js.map +0 -1
- package/dist/lib/structures/Emoji.d.ts +0 -26
- package/dist/lib/structures/Emoji.js +0 -75
- package/dist/lib/structures/Emoji.js.map +0 -1
- package/dist/lib/structures/Entitlement.d.ts +0 -24
- package/dist/lib/structures/Entitlement.js +0 -68
- package/dist/lib/structures/Entitlement.js.map +0 -1
- package/dist/lib/structures/Guild.d.ts +0 -474
- package/dist/lib/structures/Guild.js +0 -1141
- package/dist/lib/structures/Guild.js.map +0 -1
- package/dist/lib/structures/GuildMember.d.ts +0 -49
- package/dist/lib/structures/GuildMember.js +0 -146
- package/dist/lib/structures/GuildMember.js.map +0 -1
- package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -49
- package/dist/lib/structures/GuildScheduledEvent.js +0 -118
- package/dist/lib/structures/GuildScheduledEvent.js.map +0 -1
- package/dist/lib/structures/GuildTemplate.d.ts +0 -30
- package/dist/lib/structures/GuildTemplate.js +0 -72
- package/dist/lib/structures/GuildTemplate.js.map +0 -1
- package/dist/lib/structures/IdentifiableBase.d.ts +0 -15
- package/dist/lib/structures/IdentifiableBase.js +0 -25
- package/dist/lib/structures/IdentifiableBase.js.map +0 -1
- package/dist/lib/structures/Integration.d.ts +0 -31
- package/dist/lib/structures/Integration.js +0 -103
- package/dist/lib/structures/Integration.js.map +0 -1
- package/dist/lib/structures/Interaction.d.ts +0 -76
- package/dist/lib/structures/Interaction.js +0 -346
- package/dist/lib/structures/Interaction.js.map +0 -1
- package/dist/lib/structures/Invite.d.ts +0 -26
- package/dist/lib/structures/Invite.js +0 -82
- package/dist/lib/structures/Invite.js.map +0 -1
- package/dist/lib/structures/Message.d.ts +0 -86
- package/dist/lib/structures/Message.js +0 -303
- package/dist/lib/structures/Message.js.map +0 -1
- package/dist/lib/structures/Role.d.ts +0 -37
- package/dist/lib/structures/Role.js +0 -90
- package/dist/lib/structures/Role.js.map +0 -1
- package/dist/lib/structures/SKU.d.ts +0 -23
- package/dist/lib/structures/SKU.js +0 -63
- package/dist/lib/structures/SKU.js.map +0 -1
- package/dist/lib/structures/StageInstance.d.ts +0 -24
- package/dist/lib/structures/StageInstance.js +0 -57
- package/dist/lib/structures/StageInstance.js.map +0 -1
- package/dist/lib/structures/Sticker.d.ts +0 -31
- package/dist/lib/structures/Sticker.js +0 -86
- package/dist/lib/structures/Sticker.js.map +0 -1
- package/dist/lib/structures/Team.d.ts +0 -14
- package/dist/lib/structures/Team.js +0 -39
- package/dist/lib/structures/Team.js.map +0 -1
- package/dist/lib/structures/TestEntitlement.d.ts +0 -23
- package/dist/lib/structures/TestEntitlement.js +0 -61
- package/dist/lib/structures/TestEntitlement.js.map +0 -1
- package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
- package/dist/lib/structures/UnavailableGuild.js +0 -25
- package/dist/lib/structures/UnavailableGuild.js.map +0 -1
- package/dist/lib/structures/User.d.ts +0 -63
- package/dist/lib/structures/User.js +0 -177
- package/dist/lib/structures/User.js.map +0 -1
- package/dist/lib/structures/VoiceState.d.ts +0 -24
- package/dist/lib/structures/VoiceState.js +0 -66
- package/dist/lib/structures/VoiceState.js.map +0 -1
- package/dist/lib/structures/Webhook.d.ts +0 -82
- package/dist/lib/structures/Webhook.js +0 -223
- package/dist/lib/structures/Webhook.js.map +0 -1
- package/dist/lib/structures/index.d.ts +0 -28
- package/dist/lib/structures/index.js +0 -45
- package/dist/lib/structures/index.js.map +0 -1
- package/dist/lib/types/application-command.js.map +0 -1
- package/dist/lib/types/application-role-connection-metadata.js.map +0 -1
- package/dist/lib/types/application.js.map +0 -1
- package/dist/lib/types/audit-log.js.map +0 -1
- package/dist/lib/types/auto-moderation.js.map +0 -1
- package/dist/lib/types/channel.js.map +0 -1
- package/dist/lib/types/emoji.js.map +0 -1
- package/dist/lib/types/entitlements.js.map +0 -1
- package/dist/lib/types/gateway-events.js.map +0 -1
- package/dist/lib/types/guild-scheduled-event.js.map +0 -1
- package/dist/lib/types/guild-template.js.map +0 -1
- package/dist/lib/types/guild.js.map +0 -1
- package/dist/lib/types/index.js.map +0 -1
- package/dist/lib/types/interaction.js.map +0 -1
- package/dist/lib/types/invite.js.map +0 -1
- package/dist/lib/types/message-components.js.map +0 -1
- package/dist/lib/types/role.js.map +0 -1
- package/dist/lib/types/sku.js.map +0 -1
- package/dist/lib/types/stage-instance.js.map +0 -1
- package/dist/lib/types/sticker.js.map +0 -1
- package/dist/lib/types/team.js.map +0 -1
- package/dist/lib/types/user.js.map +0 -1
- package/dist/lib/types/voice.js.map +0 -1
- package/dist/lib/types/webhook.js.map +0 -1
- package/dist/lib/utils/Collection.d.ts +0 -24
- package/dist/lib/utils/Collection.js +0 -65
- package/dist/lib/utils/Collection.js.map +0 -1
- package/dist/lib/utils/Util.js.map +0 -1
- package/dist/lib/utils/errors.js.map +0 -1
- package/dist/lib/utils/index.js.map +0 -1
@@ -1,328 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Application = void 0;
|
4
|
-
const _1 = require(".");
|
5
|
-
const rest_1 = require("../rest");
|
6
|
-
/** https://discord.com/developers/docs/resources/application */
|
7
|
-
class Application extends _1.IdentifiableBase {
|
8
|
-
raw;
|
9
|
-
name;
|
10
|
-
icon;
|
11
|
-
description;
|
12
|
-
rpcOrigins;
|
13
|
-
botPublic;
|
14
|
-
botRequireCodeGrant;
|
15
|
-
termsOfServiceURL;
|
16
|
-
privacyPolicyURL;
|
17
|
-
owner;
|
18
|
-
verifyKey;
|
19
|
-
team;
|
20
|
-
guildId;
|
21
|
-
guild;
|
22
|
-
primarySKUId;
|
23
|
-
slug;
|
24
|
-
coverImage;
|
25
|
-
flags;
|
26
|
-
approximateGuildCount;
|
27
|
-
redirectURIs;
|
28
|
-
interactionsEndpointURL;
|
29
|
-
roleConnectionsVerificationURL;
|
30
|
-
tags;
|
31
|
-
installParams;
|
32
|
-
customInstallURL;
|
33
|
-
constructor(data, client) {
|
34
|
-
super(data.id, client);
|
35
|
-
this.raw = data;
|
36
|
-
this.name = data.name;
|
37
|
-
this.icon = data.icon;
|
38
|
-
this.description = data.description;
|
39
|
-
this.botPublic = data.bot_public;
|
40
|
-
this.botRequireCodeGrant = data.bot_require_code_grant;
|
41
|
-
this.verifyKey = data.verify_key;
|
42
|
-
this.team = null;
|
43
|
-
this.patch(data);
|
44
|
-
}
|
45
|
-
patch(data) {
|
46
|
-
if (data.rpc_origins !== undefined)
|
47
|
-
this.rpcOrigins = data.rpc_origins;
|
48
|
-
if (data.terms_of_service_url !== undefined)
|
49
|
-
this.termsOfServiceURL = data.terms_of_service_url;
|
50
|
-
if (data.owner !== undefined)
|
51
|
-
this.owner = new _1.User(data.owner, this.client);
|
52
|
-
if (data.team !== undefined)
|
53
|
-
this.team = data.team !== null ? new _1.Team(data.team, this.client) : null;
|
54
|
-
if (data.guild_id !== undefined)
|
55
|
-
this.guildId = data.guild_id;
|
56
|
-
if (data.guild !== undefined)
|
57
|
-
this.guild = new _1.Guild(data.guild, this.client);
|
58
|
-
if (data.primary_sku_id !== undefined)
|
59
|
-
this.primarySKUId = data.primary_sku_id;
|
60
|
-
if (data.slug !== undefined)
|
61
|
-
this.slug = data.slug;
|
62
|
-
if (data.cover_image !== undefined)
|
63
|
-
this.coverImage = data.cover_image;
|
64
|
-
if (data.flags !== undefined)
|
65
|
-
this.flags = data.flags;
|
66
|
-
if (data.approximate_guild_count !== undefined)
|
67
|
-
this.approximateGuildCount = data.approximate_guild_count;
|
68
|
-
if (data.redirect_uris !== undefined)
|
69
|
-
this.redirectURIs = data.redirect_uris;
|
70
|
-
if (data.interactions_endpoint_url !== undefined)
|
71
|
-
this.interactionsEndpointURL = data.interactions_endpoint_url;
|
72
|
-
if (data.role_connections_verification_url !== undefined)
|
73
|
-
this.roleConnectionsVerificationURL =
|
74
|
-
data.role_connections_verification_url;
|
75
|
-
if (data.tags !== undefined)
|
76
|
-
this.tags = data.tags;
|
77
|
-
if (data.install_params !== undefined)
|
78
|
-
this.installParams = data.install_params;
|
79
|
-
if (data.custom_install_url !== undefined)
|
80
|
-
this.customInstallURL = data.custom_install_url;
|
81
|
-
}
|
82
|
-
/** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
|
83
|
-
async createGlobalApplicationCommand(options) {
|
84
|
-
return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationCommands(this.id), {
|
85
|
-
json: this.client.util.applicationCommandToRaw(options),
|
86
|
-
}), this.client);
|
87
|
-
}
|
88
|
-
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
89
|
-
async createGuildApplicationCommand(guildId, options) {
|
90
|
-
return new _1.ApplicationCommand(await this.client.rest.post(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
|
91
|
-
json: this.client.util.applicationCommandToRaw(options),
|
92
|
-
}), this.client);
|
93
|
-
}
|
94
|
-
/** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
|
95
|
-
async createTestEntitlement(options) {
|
96
|
-
return new _1.TestEntitlement(await this.client.rest.post(rest_1.Endpoints.applicationEntitlements(this.id), {
|
97
|
-
json: {
|
98
|
-
sku_id: options.skuId,
|
99
|
-
owner_id: options.ownerId,
|
100
|
-
owner_type: options.ownerType,
|
101
|
-
},
|
102
|
-
}), this.client);
|
103
|
-
}
|
104
|
-
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
105
|
-
deleteGlobalApplicationCommand(commandId) {
|
106
|
-
this.client.rest.delete(rest_1.Endpoints.applicationCommand(this.id, commandId));
|
107
|
-
}
|
108
|
-
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
109
|
-
deleteGuildApplicationCommand(guildId, commandId) {
|
110
|
-
this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId));
|
111
|
-
}
|
112
|
-
/** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
|
113
|
-
deleteTestEntitlement(entitlementId) {
|
114
|
-
this.client.rest.delete(rest_1.Endpoints.applicationEntitlement(this.id, entitlementId));
|
115
|
-
}
|
116
|
-
/** https://discord.com/developers/docs/resources/application#edit-current-application */
|
117
|
-
async edit(options) {
|
118
|
-
return new Application(await this.client.rest.patch(rest_1.Endpoints.applicationCurrentUser(), {
|
119
|
-
json: {
|
120
|
-
custom_install_url: options.customInstallURL,
|
121
|
-
description: options.description,
|
122
|
-
role_connections_verification_url: options.roleConnectionsVerificationURL,
|
123
|
-
install_params: options.installParams,
|
124
|
-
flags: options.flags,
|
125
|
-
icon: options.icon,
|
126
|
-
cover_image: options.coverImage,
|
127
|
-
interactions_endpoint_url: options.interactionsEndpointURL,
|
128
|
-
tags: options.tags,
|
129
|
-
},
|
130
|
-
}), this.client);
|
131
|
-
}
|
132
|
-
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
133
|
-
async editApplicationCommandPermissions(guildId, commandId, options) {
|
134
|
-
return this.client.rest
|
135
|
-
.put(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId), {
|
136
|
-
json: {
|
137
|
-
permissions: options.permissions.map((option) => ({
|
138
|
-
id: option.id,
|
139
|
-
application_id: option.applicationId,
|
140
|
-
guild_id: option.guildId,
|
141
|
-
permissions: option.permissions.map((permission) => ({
|
142
|
-
id: permission.id,
|
143
|
-
type: permission.type,
|
144
|
-
permission: permission.permission,
|
145
|
-
})),
|
146
|
-
})),
|
147
|
-
},
|
148
|
-
})
|
149
|
-
.then((response) => ({
|
150
|
-
id: response.id,
|
151
|
-
applicationId: response.application_id,
|
152
|
-
guildId: response.guild_id,
|
153
|
-
permissions: response.permissions.map((permission) => ({
|
154
|
-
id: permission.id,
|
155
|
-
type: permission.type,
|
156
|
-
permission: permission.permission,
|
157
|
-
})),
|
158
|
-
}));
|
159
|
-
}
|
160
|
-
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
161
|
-
async editGlobalApplicationCommand(commandId, options) {
|
162
|
-
return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationCommand(this.id, commandId), {
|
163
|
-
json: this.client.util.applicationCommandToRaw(options),
|
164
|
-
}), this.client);
|
165
|
-
}
|
166
|
-
/** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
|
167
|
-
async editGuildApplicationCommand(guildId, commandId, options) {
|
168
|
-
return new _1.ApplicationCommand(await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId), {
|
169
|
-
json: this.client.util.applicationCommandToRaw(options),
|
170
|
-
}), this.client);
|
171
|
-
}
|
172
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
173
|
-
async getApplicationCommandPermissions(guildId, commandId) {
|
174
|
-
return this.client.rest
|
175
|
-
.get(rest_1.Endpoints.applicationCommandPermissions(this.id, guildId, commandId))
|
176
|
-
.then((response) => response.map((permissions) => ({
|
177
|
-
id: permissions.id,
|
178
|
-
applicationId: permissions.application_id,
|
179
|
-
guildId: permissions.guild_id,
|
180
|
-
permissions: permissions.permissions.map((permission) => ({
|
181
|
-
id: permission.id,
|
182
|
-
type: permission.type,
|
183
|
-
permission: permission.permission,
|
184
|
-
})),
|
185
|
-
})));
|
186
|
-
}
|
187
|
-
/** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
|
188
|
-
async getEntitlements(options) {
|
189
|
-
return this.client.rest
|
190
|
-
.get(rest_1.Endpoints.applicationEntitlements(this.id), {
|
191
|
-
query: {
|
192
|
-
user_id: options?.userId,
|
193
|
-
sku_ids: options?.skuIds,
|
194
|
-
before: options?.before,
|
195
|
-
after: options?.after,
|
196
|
-
limit: options?.limit,
|
197
|
-
guild_id: options?.guildId,
|
198
|
-
exclude_ended: options?.excludeEnded,
|
199
|
-
},
|
200
|
-
})
|
201
|
-
.then((response) => response.map((data) => new _1.Entitlement(data, this.client)));
|
202
|
-
}
|
203
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
|
204
|
-
async getGlobalApplicationCommand(commandId) {
|
205
|
-
return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationCommand(this.id, commandId)), this.client);
|
206
|
-
}
|
207
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
|
208
|
-
async getGlobalApplicationCommands(options) {
|
209
|
-
return this.client.rest
|
210
|
-
.get(rest_1.Endpoints.applicationCommands(this.id), {
|
211
|
-
query: {
|
212
|
-
with_localizations: options.withLocalizations,
|
213
|
-
},
|
214
|
-
})
|
215
|
-
.then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
|
216
|
-
}
|
217
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
|
218
|
-
async getGuildApplicationCommand(guildId, commandId) {
|
219
|
-
return new _1.ApplicationCommand(await this.client.rest.get(rest_1.Endpoints.applicationGuildCommand(this.id, guildId, commandId)), this.client);
|
220
|
-
}
|
221
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
222
|
-
async getGuildApplicationCommands(guildId, options) {
|
223
|
-
return this.client.rest
|
224
|
-
.get(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
|
225
|
-
query: {
|
226
|
-
with_localizations: options?.withLocalizations,
|
227
|
-
},
|
228
|
-
})
|
229
|
-
.then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
|
230
|
-
}
|
231
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
|
232
|
-
async getGuildApplicationCommandPermissions(guildId) {
|
233
|
-
return this.client.rest
|
234
|
-
.get(rest_1.Endpoints.guildApplicationCommandsPermissions(this.id, guildId))
|
235
|
-
.then((response) => response.map((permissions) => ({
|
236
|
-
id: permissions.id,
|
237
|
-
applicationId: permissions.application_id,
|
238
|
-
guildId: permissions.guild_id,
|
239
|
-
permissions: permissions.permissions.map((permission) => ({
|
240
|
-
id: permission.id,
|
241
|
-
type: permission.type,
|
242
|
-
permission: permission.permission,
|
243
|
-
})),
|
244
|
-
})));
|
245
|
-
}
|
246
|
-
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
|
247
|
-
async getApplicationRoleConnectionMetadataRecords() {
|
248
|
-
return this.client.rest
|
249
|
-
.get(rest_1.Endpoints.applicationRoleConnectionMetadata(this.id))
|
250
|
-
.then((response) => response.map((data) => ({
|
251
|
-
type: data.type,
|
252
|
-
key: data.key,
|
253
|
-
name: data.name,
|
254
|
-
nameLocalizations: data.name_localizations,
|
255
|
-
description: data.description,
|
256
|
-
descriptionLocalizations: data.description_localizations,
|
257
|
-
})));
|
258
|
-
}
|
259
|
-
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
260
|
-
async getSKUs() {
|
261
|
-
return this.client.rest
|
262
|
-
.get(rest_1.Endpoints.applicationSKUs(this.id))
|
263
|
-
.then((response) => response.map((data) => new _1.SKU(data, this.client)));
|
264
|
-
}
|
265
|
-
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
|
266
|
-
async setGlobalApplicationCommands(commands) {
|
267
|
-
return this.client.rest
|
268
|
-
.put(rest_1.Endpoints.applicationCommands(this.id), {
|
269
|
-
json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
|
270
|
-
})
|
271
|
-
.then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
|
272
|
-
}
|
273
|
-
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
274
|
-
async setGuildApplicationCommands(guildId, commands) {
|
275
|
-
return this.client.rest
|
276
|
-
.put(rest_1.Endpoints.applicationGuildCommands(this.id, guildId), {
|
277
|
-
json: commands.map((command) => this.client.util.applicationCommandToRaw(command)),
|
278
|
-
})
|
279
|
-
.then((response) => response.map((data) => new _1.ApplicationCommand(data, this.client)));
|
280
|
-
}
|
281
|
-
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
282
|
-
async updateApplicationRoleConnectionMetadataRecords() {
|
283
|
-
return this.client.rest
|
284
|
-
.put(rest_1.Endpoints.applicationRoleConnectionMetadata(this.id))
|
285
|
-
.then((response) => response.map((data) => ({
|
286
|
-
type: data.type,
|
287
|
-
key: data.key,
|
288
|
-
name: data.name,
|
289
|
-
nameLocalizations: data.name_localizations,
|
290
|
-
description: data.description,
|
291
|
-
descriptionLocalizations: data.description_localizations,
|
292
|
-
})));
|
293
|
-
}
|
294
|
-
toRaw() {
|
295
|
-
return this.raw;
|
296
|
-
}
|
297
|
-
toJSON() {
|
298
|
-
return {
|
299
|
-
...super.toJSON(),
|
300
|
-
name: this.name,
|
301
|
-
icon: this.icon,
|
302
|
-
description: this.description,
|
303
|
-
rpcOrigins: this.rpcOrigins,
|
304
|
-
botPublic: this.botPublic,
|
305
|
-
botRequireCodeGrant: this.botRequireCodeGrant,
|
306
|
-
termsOfServiceURL: this.termsOfServiceURL,
|
307
|
-
privacyPolicyURL: this.privacyPolicyURL,
|
308
|
-
owner: this.owner?.toJSON(),
|
309
|
-
verifyKey: this.verifyKey,
|
310
|
-
team: this.team?.toJSON() ?? null,
|
311
|
-
guildId: this.guildId,
|
312
|
-
guild: this.guild?.toJSON(),
|
313
|
-
primarySKUId: this.primarySKUId,
|
314
|
-
slug: this.slug,
|
315
|
-
coverImage: this.coverImage,
|
316
|
-
flags: this.flags,
|
317
|
-
approximateGuildCount: this.approximateGuildCount,
|
318
|
-
redirectURIs: this.redirectURIs,
|
319
|
-
interactionsEndpointURL: this.interactionsEndpointURL,
|
320
|
-
roleConnectionsVerificationURL: this.roleConnectionsVerificationURL,
|
321
|
-
tags: this.tags,
|
322
|
-
installParams: this.installParams,
|
323
|
-
customInstallURL: this.customInstallURL,
|
324
|
-
};
|
325
|
-
}
|
326
|
-
}
|
327
|
-
exports.Application = Application;
|
328
|
-
//# sourceMappingURL=Application.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../../../lib/structures/Application.ts"],"names":[],"mappings":";;;AAAA,wBASW;AAeX,kCAAoC;AAOpC,gEAAgE;AAChE,MAAa,WAAY,SAAQ,mBAAgB;IAC5B,GAAG,CAAiB;IAEvC,IAAI,CAAS;IACb,IAAI,CAAgB;IACpB,WAAW,CAAS;IACpB,UAAU,CAAiB;IAC3B,SAAS,CAAU;IACnB,mBAAmB,CAAU;IAC7B,iBAAiB,CAAU;IAC3B,gBAAgB,CAAU;IAC1B,KAAK,CAAQ;IACb,SAAS,CAAS;IAClB,IAAI,CAAc;IAClB,OAAO,CAAU;IACjB,KAAK,CAAS;IACd,YAAY,CAAU;IACtB,IAAI,CAAU;IACd,UAAU,CAAU;IACpB,KAAK,CAAoB;IACzB,qBAAqB,CAAU;IAC/B,YAAY,CAAiB;IAC7B,uBAAuB,CAAU;IACjC,8BAA8B,CAAU;IACxC,IAAI,CAAiB;IACrB,aAAa,CAAqB;IAClC,gBAAgB,CAAU;IAE1B,YAAY,IAAoB,EAAE,MAAc;QAC9C,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAEvB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,CA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I;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;YAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;YAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;YACjD,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;YACrD,8BAA8B,EAAE,IAAI,CAAC,8BAA8B;YACnE,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACxC,CAAC;IACJ,CAAC;CACF;AAvjBD,kCAujBC"}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import type { Client } from "../Client";
|
2
|
-
import type { JSONApplicationCommand, JSONApplicationCommandOption, JSONApplicationCommandPermission, JSONGuildApplicationCommandPermissions, RawApplicationCommand } from "../types";
|
3
|
-
import type { ApplicationCommandTypes, Locales } from "../constants";
|
4
|
-
import { IdentifiableBase } from ".";
|
5
|
-
/** https://discord.com/developers/docs/interactions/application-commands */
|
6
|
-
export declare class ApplicationCommand extends IdentifiableBase {
|
7
|
-
protected raw: RawApplicationCommand;
|
8
|
-
type?: ApplicationCommandTypes;
|
9
|
-
applicationId: string;
|
10
|
-
guildId?: string;
|
11
|
-
name: string;
|
12
|
-
nameLocalizations?: Partial<Record<Locales, string>> | null;
|
13
|
-
description: string;
|
14
|
-
descriptionLocalizations?: Partial<Record<Locales, string>> | null;
|
15
|
-
options?: Array<JSONApplicationCommandOption>;
|
16
|
-
defaultMemberPermissions: string | null;
|
17
|
-
dmPermission?: boolean;
|
18
|
-
defaultPermission?: boolean | null;
|
19
|
-
nsfw?: boolean;
|
20
|
-
version: string;
|
21
|
-
constructor(data: RawApplicationCommand, client: Client);
|
22
|
-
protected patch(data: RawApplicationCommand): void;
|
23
|
-
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
24
|
-
delete(): void;
|
25
|
-
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
26
|
-
edit(options: {
|
27
|
-
name?: string;
|
28
|
-
nameLocalizations?: Partial<Record<Locales, string>> | null;
|
29
|
-
description?: string;
|
30
|
-
descriptionLocalizations?: Partial<Record<Locales, string>> | null;
|
31
|
-
options?: Array<JSONApplicationCommandOption>;
|
32
|
-
defaultMemberPermissions?: string | null;
|
33
|
-
defaultPermission?: boolean | null;
|
34
|
-
dmPermission?: boolean;
|
35
|
-
nsfw?: boolean;
|
36
|
-
}): Promise<ApplicationCommand>;
|
37
|
-
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
38
|
-
editPermissions(options: {
|
39
|
-
permissions: Array<JSONApplicationCommandPermission>;
|
40
|
-
}): Promise<JSONGuildApplicationCommandPermissions>;
|
41
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
42
|
-
getPermissions(): Promise<JSONGuildApplicationCommandPermissions>;
|
43
|
-
toRaw(): RawApplicationCommand;
|
44
|
-
toJSON(): JSONApplicationCommand;
|
45
|
-
}
|
@@ -1,127 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.ApplicationCommand = void 0;
|
4
|
-
const rest_1 = require("../rest");
|
5
|
-
const _1 = require(".");
|
6
|
-
/** https://discord.com/developers/docs/interactions/application-commands */
|
7
|
-
class ApplicationCommand extends _1.IdentifiableBase {
|
8
|
-
raw;
|
9
|
-
type;
|
10
|
-
applicationId;
|
11
|
-
guildId;
|
12
|
-
name;
|
13
|
-
nameLocalizations;
|
14
|
-
description;
|
15
|
-
descriptionLocalizations;
|
16
|
-
options;
|
17
|
-
defaultMemberPermissions;
|
18
|
-
dmPermission;
|
19
|
-
defaultPermission;
|
20
|
-
nsfw;
|
21
|
-
version;
|
22
|
-
constructor(data, client) {
|
23
|
-
super(data.id, client);
|
24
|
-
this.raw = data;
|
25
|
-
this.applicationId = data.application_id;
|
26
|
-
this.name = data.name;
|
27
|
-
this.description = data.description;
|
28
|
-
this.defaultMemberPermissions = data.default_member_permissions;
|
29
|
-
this.version = data.version;
|
30
|
-
this.patch(data);
|
31
|
-
}
|
32
|
-
patch(data) {
|
33
|
-
if (data.type !== undefined)
|
34
|
-
this.type = data.type;
|
35
|
-
if (data.guild_id !== undefined)
|
36
|
-
this.guildId = data.guild_id;
|
37
|
-
if (data.name_localizations !== undefined)
|
38
|
-
this.nameLocalizations = data.name_localizations;
|
39
|
-
if (data.description_localizations !== undefined)
|
40
|
-
this.descriptionLocalizations = data.description_localizations;
|
41
|
-
if (data.options !== undefined)
|
42
|
-
this.options = data.options;
|
43
|
-
if (data.dm_permission !== undefined)
|
44
|
-
this.dmPermission = data.dm_permission;
|
45
|
-
if (data.default_permission !== undefined)
|
46
|
-
this.defaultPermission = data.default_permission;
|
47
|
-
if (data.nsfw !== undefined)
|
48
|
-
this.nsfw = data.nsfw;
|
49
|
-
}
|
50
|
-
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
51
|
-
delete() {
|
52
|
-
this.guildId !== undefined
|
53
|
-
? this.client.rest.delete(rest_1.Endpoints.applicationGuildCommand(this.applicationId, this.guildId, this.id))
|
54
|
-
: this.client.rest.delete(rest_1.Endpoints.applicationCommand(this.applicationId, this.id));
|
55
|
-
}
|
56
|
-
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
57
|
-
async edit(options) {
|
58
|
-
return new ApplicationCommand(this.guildId !== undefined
|
59
|
-
? await this.client.rest.patch(rest_1.Endpoints.applicationGuildCommand(this.id, this.guildId, this.id), {
|
60
|
-
json: this.client.util.applicationCommandToRaw(options),
|
61
|
-
})
|
62
|
-
: await this.client.rest.patch(rest_1.Endpoints.applicationCommand(this.applicationId, this.id), {
|
63
|
-
json: this.client.util.applicationCommandToRaw(options),
|
64
|
-
}), this.client);
|
65
|
-
}
|
66
|
-
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
67
|
-
async editPermissions(options) {
|
68
|
-
if (!this.guildId)
|
69
|
-
throw new Error("[disgroove] Cannot edit the permissions of a global application command");
|
70
|
-
return this.client.rest
|
71
|
-
.put(rest_1.Endpoints.applicationCommandPermissions(this.applicationId, this.guildId, this.id), {
|
72
|
-
json: {
|
73
|
-
permissions: options.permissions,
|
74
|
-
},
|
75
|
-
})
|
76
|
-
.then((response) => ({
|
77
|
-
id: response.id,
|
78
|
-
applicationId: response.application_id,
|
79
|
-
guildId: response.guild_id,
|
80
|
-
permissions: response.permissions.map((permission) => ({
|
81
|
-
id: permission.id,
|
82
|
-
type: permission.type,
|
83
|
-
permission: permission.permission,
|
84
|
-
})),
|
85
|
-
}));
|
86
|
-
}
|
87
|
-
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
88
|
-
async getPermissions() {
|
89
|
-
if (!this.guildId)
|
90
|
-
throw new Error("[disgroove] Cannot get the permissions of a global application command");
|
91
|
-
return this.client.rest
|
92
|
-
.get(rest_1.Endpoints.applicationCommandPermissions(this.applicationId, this.guildId, this.id))
|
93
|
-
.then((response) => ({
|
94
|
-
id: response.id,
|
95
|
-
applicationId: response.application_id,
|
96
|
-
guildId: response.guild_id,
|
97
|
-
permissions: response.permissions.map((permission) => ({
|
98
|
-
id: permission.id,
|
99
|
-
type: permission.type,
|
100
|
-
permission: permission.permission,
|
101
|
-
})),
|
102
|
-
}));
|
103
|
-
}
|
104
|
-
toRaw() {
|
105
|
-
return this.raw;
|
106
|
-
}
|
107
|
-
toJSON() {
|
108
|
-
return {
|
109
|
-
...super.toJSON(),
|
110
|
-
type: this.type,
|
111
|
-
applicationId: this.applicationId,
|
112
|
-
guildId: this.guildId,
|
113
|
-
name: this.name,
|
114
|
-
nameLocalizations: this.nameLocalizations,
|
115
|
-
description: this.description,
|
116
|
-
descriptionLocalizations: this.descriptionLocalizations,
|
117
|
-
options: this.options,
|
118
|
-
defaultMemberPermissions: this.defaultMemberPermissions,
|
119
|
-
dmPermission: this.dmPermission,
|
120
|
-
defaultPermission: this.defaultPermission,
|
121
|
-
nsfw: this.nsfw,
|
122
|
-
version: this.version,
|
123
|
-
};
|
124
|
-
}
|
125
|
-
}
|
126
|
-
exports.ApplicationCommand = ApplicationCommand;
|
127
|
-
//# sourceMappingURL=ApplicationCommand.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ApplicationCommand.js","sourceRoot":"","sources":["../../../lib/structures/ApplicationCommand.ts"],"names":[],"mappings":";;;AACA,kCAAoC;AAUpC,wBAAqC;AAErC,4EAA4E;AAC5E,MAAa,kBAAmB,SAAQ,mBAAgB;IACnC,GAAG,CAAwB;IAE9C,IAAI,CAA2B;IAC/B,aAAa,CAAS;IACtB,OAAO,CAAU;IACjB,IAAI,CAAS;IACb,iBAAiB,CAA2C;IAC5D,WAAW,CAAS;IACpB,wBAAwB,CAA2C;IACnE,OAAO,CAAuC;IAC9C,wBAAwB,CAAgB;IACxC,YAAY,CAAW;IACvB,iBAAiB,CAAkB;IACnC,IAAI,CAAW;IACf,OAAO,CAAS;IAEhB,YAAY,IAA2B,EAAE,MAAc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AE,EAAE,UAAU,CAAC,EAAE;gBACjB,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,UAAU,EAAE,UAAU,CAAC,UAAU;aAClC,CAAC,CAAC;SACJ,CAAC,CAAC,CAAC;IACR,CAAC;IAEQ,KAAK;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAEQ,MAAM;QACb,OAAO;YACL,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;YACvD,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF;AA7KD,gDA6KC"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { ApplicationCommand, AutoModerationRule, Base, Channel, GuildScheduledEvent, Integration, User, Webhook } from ".";
|
2
|
-
import type { Client } from "../Client";
|
3
|
-
import type { JSONAuditLog, JSONAuditLogEntry, RawAuditLog } from "../types";
|
4
|
-
import { Collection } from "../utils";
|
5
|
-
/** https://discord.com/developers/docs/resources/audit-log */
|
6
|
-
export declare class AuditLog extends Base {
|
7
|
-
protected raw: RawAuditLog;
|
8
|
-
applicationCommands: Collection<string, ApplicationCommand>;
|
9
|
-
auditLogEntries: Collection<string, JSONAuditLogEntry>;
|
10
|
-
autoModerationRules: Collection<string, AutoModerationRule>;
|
11
|
-
guildScheduledEvents: Collection<string, GuildScheduledEvent>;
|
12
|
-
integrations: Collection<string, Integration>;
|
13
|
-
threads: Collection<string, Channel>;
|
14
|
-
users: Collection<string, User>;
|
15
|
-
webhooks: Collection<string, Webhook>;
|
16
|
-
constructor(data: RawAuditLog, client: Client);
|
17
|
-
toRaw(): RawAuditLog;
|
18
|
-
toJSON(): JSONAuditLog;
|
19
|
-
}
|
@@ -1,101 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.AuditLog = void 0;
|
4
|
-
const _1 = require(".");
|
5
|
-
const utils_1 = require("../utils");
|
6
|
-
/** https://discord.com/developers/docs/resources/audit-log */
|
7
|
-
class AuditLog extends _1.Base {
|
8
|
-
raw;
|
9
|
-
applicationCommands;
|
10
|
-
auditLogEntries;
|
11
|
-
autoModerationRules;
|
12
|
-
guildScheduledEvents;
|
13
|
-
integrations;
|
14
|
-
threads;
|
15
|
-
users;
|
16
|
-
webhooks;
|
17
|
-
constructor(data, client) {
|
18
|
-
super(client);
|
19
|
-
this.raw = data;
|
20
|
-
this.applicationCommands = new utils_1.Collection();
|
21
|
-
this.auditLogEntries = new utils_1.Collection();
|
22
|
-
this.autoModerationRules = new utils_1.Collection();
|
23
|
-
this.guildScheduledEvents = new utils_1.Collection();
|
24
|
-
this.integrations = new utils_1.Collection();
|
25
|
-
this.threads = new utils_1.Collection();
|
26
|
-
this.users = new utils_1.Collection();
|
27
|
-
this.webhooks = new utils_1.Collection();
|
28
|
-
for (const applicationCommand of data.application_commands)
|
29
|
-
this.applicationCommands.set(applicationCommand.id, new _1.ApplicationCommand(applicationCommand, this.client));
|
30
|
-
for (const auditLogEntry of data.audit_log_entries)
|
31
|
-
this.auditLogEntries.set(auditLogEntry.id, {
|
32
|
-
targetId: auditLogEntry.target_id,
|
33
|
-
changes: auditLogEntry.changes?.map((change) => ({
|
34
|
-
newValue: change.new_value,
|
35
|
-
oldValue: change.old_value,
|
36
|
-
key: change.key,
|
37
|
-
})),
|
38
|
-
userId: auditLogEntry.user_id,
|
39
|
-
id: auditLogEntry.id,
|
40
|
-
actionType: auditLogEntry.action_type,
|
41
|
-
options: auditLogEntry.options !== undefined
|
42
|
-
? {
|
43
|
-
applicationId: auditLogEntry.options.application_id,
|
44
|
-
autoModerationRuleName: auditLogEntry.options.auto_moderation_rule_name,
|
45
|
-
autoModerationRuleTriggerType: auditLogEntry.options.auto_moderation_rule_trigger_type,
|
46
|
-
channelId: auditLogEntry.options.channel_id,
|
47
|
-
count: auditLogEntry.options.count,
|
48
|
-
deleteMemberDays: auditLogEntry.options.delete_member_days,
|
49
|
-
id: auditLogEntry.options.id,
|
50
|
-
membersRemoved: auditLogEntry.options.members_removed,
|
51
|
-
messageId: auditLogEntry.options.message_id,
|
52
|
-
roleName: auditLogEntry.options.role_name,
|
53
|
-
type: auditLogEntry.options.type,
|
54
|
-
integrationType: auditLogEntry.options.integration_type,
|
55
|
-
}
|
56
|
-
: undefined,
|
57
|
-
reason: auditLogEntry.reason,
|
58
|
-
});
|
59
|
-
for (const autoModerationRule of data.auto_moderation_rules)
|
60
|
-
this.autoModerationRules.set(autoModerationRule.id, new _1.AutoModerationRule(autoModerationRule, this.client));
|
61
|
-
for (const guildScheduledEvent of data.guild_scheduled_events)
|
62
|
-
this.guildScheduledEvents.set(guildScheduledEvent.id, new _1.GuildScheduledEvent(guildScheduledEvent, this.client));
|
63
|
-
for (const integration of data.integrations)
|
64
|
-
this.integrations.set(integration.id, new _1.Integration(integration, this.client));
|
65
|
-
for (const thread of data.threads)
|
66
|
-
this.threads.set(thread.id, new _1.Channel(thread, this.client));
|
67
|
-
for (const user of data.users)
|
68
|
-
this.users.set(user.id, new _1.User(user, this.client));
|
69
|
-
for (const webhook of data.webhooks)
|
70
|
-
this.webhooks.set(webhook.id, new _1.Webhook(webhook, this.client));
|
71
|
-
}
|
72
|
-
toRaw() {
|
73
|
-
return this.raw;
|
74
|
-
}
|
75
|
-
toJSON() {
|
76
|
-
return {
|
77
|
-
applicationCommands: new utils_1.Collection(this.applicationCommands?.map((applicationCommand) => [
|
78
|
-
applicationCommand.id,
|
79
|
-
applicationCommand.toJSON(),
|
80
|
-
])),
|
81
|
-
auditLogEntries: this.auditLogEntries,
|
82
|
-
autoModerationRules: new utils_1.Collection(this.autoModerationRules?.map((autoModerationRule) => [
|
83
|
-
autoModerationRule.id,
|
84
|
-
autoModerationRule.toJSON(),
|
85
|
-
])),
|
86
|
-
guildScheduledEvents: new utils_1.Collection(this.guildScheduledEvents?.map((guildScheduledEvent) => [
|
87
|
-
guildScheduledEvent.id,
|
88
|
-
guildScheduledEvent.toJSON(),
|
89
|
-
])),
|
90
|
-
integrations: new utils_1.Collection(this.integrations?.map((integration) => [
|
91
|
-
integration.id,
|
92
|
-
integration.toJSON(),
|
93
|
-
])),
|
94
|
-
threads: new utils_1.Collection(this.threads?.map((thread) => [thread.id, thread.toJSON()])),
|
95
|
-
users: new utils_1.Collection(this.users?.map((user) => [user.id, user.toJSON()])),
|
96
|
-
webhooks: new utils_1.Collection(this.webhooks?.map((webhook) => [webhook.id, webhook.toJSON()])),
|
97
|
-
};
|
98
|
-
}
|
99
|
-
}
|
100
|
-
exports.AuditLog = AuditLog;
|
101
|
-
//# sourceMappingURL=AuditLog.js.map
|