disgroove 1.3.3 → 1.3.4-dev.9e27a4b

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.
Files changed (73) hide show
  1. package/dist/lib/Client.d.ts +11 -3
  2. package/dist/lib/Client.js +4 -4
  3. package/dist/lib/Client.js.map +1 -1
  4. package/dist/lib/gateway/Shard.js +2 -2
  5. package/dist/lib/structures/Guild.d.ts +7 -7
  6. package/dist/package.json +1 -1
  7. package/package.json +1 -1
  8. package/lib/Client.ts +0 -616
  9. package/lib/constants.ts +0 -1173
  10. package/lib/gateway/Shard.ts +0 -704
  11. package/lib/gateway/ShardsManager.ts +0 -11
  12. package/lib/gateway/index.ts +0 -2
  13. package/lib/index.ts +0 -7
  14. package/lib/rest/CDN.ts +0 -56
  15. package/lib/rest/Endpoints.ts +0 -241
  16. package/lib/rest/REST.ts +0 -45
  17. package/lib/rest/RequestsManager.ts +0 -134
  18. package/lib/rest/index.ts +0 -4
  19. package/lib/structures/Application.ts +0 -599
  20. package/lib/structures/ApplicationCommand.ts +0 -187
  21. package/lib/structures/AuditLog.ts +0 -112
  22. package/lib/structures/AutoModerationRule.ts +0 -127
  23. package/lib/structures/Base.ts +0 -39
  24. package/lib/structures/Channel.ts +0 -921
  25. package/lib/structures/ClientApplication.ts +0 -515
  26. package/lib/structures/Emoji.ts +0 -95
  27. package/lib/structures/Entitlement.ts +0 -65
  28. package/lib/structures/Guild.ts +0 -1842
  29. package/lib/structures/GuildMember.ts +0 -193
  30. package/lib/structures/GuildScheduledEvent.ts +0 -164
  31. package/lib/structures/GuildTemplate.ts +0 -103
  32. package/lib/structures/Integration.ts +0 -136
  33. package/lib/structures/Interaction.ts +0 -506
  34. package/lib/structures/Invite.ts +0 -108
  35. package/lib/structures/Message.ts +0 -421
  36. package/lib/structures/Role.ts +0 -116
  37. package/lib/structures/SKU.ts +0 -63
  38. package/lib/structures/StageInstance.ts +0 -74
  39. package/lib/structures/Sticker.ts +0 -100
  40. package/lib/structures/Team.ts +0 -41
  41. package/lib/structures/TestEntitlement.ts +0 -78
  42. package/lib/structures/UnavailableGuild.ts +0 -27
  43. package/lib/structures/User.ts +0 -233
  44. package/lib/structures/VoiceState.ts +0 -72
  45. package/lib/structures/Webhook.ts +0 -341
  46. package/lib/structures/index.ts +0 -27
  47. package/lib/types/application-command.ts +0 -118
  48. package/lib/types/application-role-connection-metadata.ts +0 -23
  49. package/lib/types/application.ts +0 -77
  50. package/lib/types/audit-log.ts +0 -105
  51. package/lib/types/auto-moderation.ts +0 -78
  52. package/lib/types/channel.ts +0 -534
  53. package/lib/types/emoji.ts +0 -24
  54. package/lib/types/entitlements.ts +0 -34
  55. package/lib/types/gateway-events.ts +0 -970
  56. package/lib/types/guild-scheduled-event.ts +0 -67
  57. package/lib/types/guild-template.ts +0 -30
  58. package/lib/types/guild.ts +0 -388
  59. package/lib/types/index.ts +0 -23
  60. package/lib/types/interaction.ts +0 -224
  61. package/lib/types/invite.ts +0 -78
  62. package/lib/types/message-components.ts +0 -127
  63. package/lib/types/role.ts +0 -51
  64. package/lib/types/sku.ts +0 -32
  65. package/lib/types/stage-instance.ts +0 -22
  66. package/lib/types/sticker.ts +0 -67
  67. package/lib/types/team.ts +0 -34
  68. package/lib/types/user.ts +0 -93
  69. package/lib/types/voice.ts +0 -51
  70. package/lib/types/webhook.ts +0 -40
  71. package/lib/utils/Util.ts +0 -600
  72. package/lib/utils/errors.ts +0 -23
  73. package/lib/utils/index.ts +0 -2
@@ -1,341 +0,0 @@
1
- import { Base, Channel, Guild, Message, User } from ".";
2
- import type { Client } from "../Client";
3
- import { Endpoints, type File } from "../rest";
4
- import type {
5
- JSONActionRow,
6
- JSONAllowedMentions,
7
- JSONAttachment,
8
- JSONEmbed,
9
- JSONWebhook,
10
- RawMessage,
11
- RawWebhook,
12
- } from "../types";
13
- import type { MessageFlags, WebhookTypes } from "../constants";
14
-
15
- /** https://discord.com/developers/docs/resources/webhook */
16
- export class Webhook extends Base {
17
- protected override raw: RawWebhook;
18
- type: WebhookTypes;
19
- guildId?: string | null;
20
- channelId: string | null;
21
- user?: User;
22
- name: string | null;
23
- avatar: string | null;
24
- token?: string;
25
- applicationId: string | null;
26
- sourceGuild?: Guild;
27
- sourceChannel?: Channel;
28
- url?: string;
29
-
30
- constructor(data: RawWebhook, client: Client) {
31
- super(data.id, client);
32
-
33
- this.raw = data;
34
- this.type = data.type;
35
- this.channelId = data.channel_id;
36
- this.name = data.name;
37
- this.avatar = data.avatar;
38
- this.applicationId = data.application_id;
39
-
40
- this.patch(data);
41
- }
42
-
43
- protected override patch(data: RawWebhook): void {
44
- if (data.guild_id !== undefined) this.guildId = data.guild_id;
45
- if (data.user !== undefined) this.user = new User(data.user, this.client);
46
- if (data.token !== undefined) this.token = data.token;
47
- if (data.source_guild !== undefined)
48
- this.sourceGuild = new Guild(data.source_guild, this.client);
49
- if (data.source_channel !== undefined)
50
- this.sourceChannel = new Channel(data.source_channel, this.client);
51
- if (data.url !== undefined) this.url = data.url;
52
- }
53
-
54
- /** https://discord.com/developers/docs/resources/webhook#delete-webhook */
55
- delete(reason?: string): void {
56
- this.client.rest.delete(Endpoints.webhook(this.id), {
57
- reason,
58
- });
59
- }
60
-
61
- /** https://discord.com/developers/docs/resources/webhook#delete-webhook-message */
62
- deleteMessage(
63
- messageId: string,
64
- options?: {
65
- threadId?: string;
66
- }
67
- ): void {
68
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
69
-
70
- this.client.rest.delete(
71
- Endpoints.webhookMessage(this.id, this.token, messageId),
72
- {
73
- query: {
74
- thread_id: options?.threadId,
75
- },
76
- }
77
- );
78
- }
79
-
80
- /** https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */
81
- deleteWithToken(reason?: string): void {
82
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
83
-
84
- this.client.rest.delete(Endpoints.webhook(this.id, this.token), {
85
- reason,
86
- authorization: false,
87
- });
88
- }
89
-
90
- /** https://discord.com/developers/docs/resources/webhook#modify-webhook */
91
- async edit(
92
- options: {
93
- name?: string;
94
- avatar?: string | null;
95
- channelId?: string;
96
- },
97
- reason?: string
98
- ): Promise<Webhook> {
99
- return new Webhook(
100
- await this.client.rest.patch<RawWebhook>(Endpoints.webhook(this.id), {
101
- json: {
102
- name: options.name,
103
- avatar: options.avatar,
104
- channel_id: options.channelId,
105
- },
106
- reason,
107
- }),
108
- this.client
109
- );
110
- }
111
-
112
- /** https://discord.com/developers/docs/resources/webhook#edit-webhook-message */
113
- async editMessage(
114
- messageId: string,
115
- options: {
116
- threadId?: string;
117
- content?: string | null;
118
- embeds?: Array<JSONEmbed> | null;
119
- flags?: MessageFlags | null;
120
- allowedMentions?: JSONAllowedMentions | null;
121
- components?: Array<JSONActionRow> | null;
122
- files?: Array<File> | null;
123
- attachments?: Array<JSONAttachment> | null;
124
- }
125
- ): Promise<Message> {
126
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
127
-
128
- return new Message(
129
- await this.client.rest.patch<RawMessage>(
130
- Endpoints.webhookMessage(this.id, this.token, messageId),
131
- {
132
- json: {
133
- content: options.content,
134
- embeds:
135
- options.embeds !== undefined
136
- ? options.embeds !== null
137
- ? this.client.util.embedsToRaw(options.embeds)
138
- : null
139
- : undefined,
140
- allowed_mentions: {
141
- parse: options.allowedMentions?.parse,
142
- roles: options.allowedMentions?.roles,
143
- users: options.allowedMentions?.users,
144
- replied_user: options.allowedMentions?.repliedUser,
145
- },
146
- components:
147
- options.components !== undefined
148
- ? options.components !== null
149
- ? this.client.util.messageComponentsToRaw(options.components)
150
- : null
151
- : undefined,
152
- attachments: options.attachments,
153
- flags: options.flags,
154
- },
155
- files: options.files,
156
- query: {
157
- thread_id: options.threadId,
158
- },
159
- }
160
- ),
161
- this.client
162
- );
163
- }
164
-
165
- /** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
166
- async editWithToken(
167
- options: {
168
- name?: string;
169
- avatar?: string | null;
170
- },
171
- reason?: string
172
- ): Promise<Webhook> {
173
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
174
-
175
- return new Webhook(
176
- await this.client.rest.patch<RawWebhook>(
177
- Endpoints.webhook(this.id, this.token),
178
- {
179
- json: {
180
- name: options.name,
181
- avatar: options.avatar,
182
- },
183
- reason,
184
- authorization: false,
185
- }
186
- ),
187
- this.client
188
- );
189
- }
190
-
191
- /** https://discord.com/developers/docs/resources/webhook#execute-webhook */
192
- async execute(options: {
193
- wait?: boolean;
194
- threadId?: string;
195
- content?: string | null;
196
- username?: string;
197
- avatarURL?: string;
198
- tts?: boolean;
199
- embeds?: Array<JSONEmbed> | null;
200
- allowedMentions?: JSONAllowedMentions | null;
201
- components?: Array<JSONActionRow> | null;
202
- files?: Array<File> | null;
203
- attachments?: Array<JSONAttachment> | null;
204
- flags?: MessageFlags | null;
205
- threadName?: string;
206
- }): Promise<Message | null> {
207
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
208
-
209
- return this.client.rest
210
- .post<RawMessage | null>(Endpoints.webhook(this.id, this.token), {
211
- json: {
212
- content: options.content,
213
- tts: options.tts,
214
- embeds:
215
- options.embeds !== undefined
216
- ? options.embeds !== null
217
- ? this.client.util.embedsToRaw(options.embeds)
218
- : null
219
- : undefined,
220
- allowed_mentions: {
221
- parse: options.allowedMentions?.parse,
222
- roles: options.allowedMentions?.roles,
223
- users: options.allowedMentions?.users,
224
- replied_user: options.allowedMentions?.repliedUser,
225
- },
226
- components:
227
- options.components !== undefined
228
- ? options.components !== null
229
- ? this.client.util.messageComponentsToRaw(options.components)
230
- : null
231
- : undefined,
232
- attachments: options.attachments,
233
- flags: options.flags,
234
- thread_name: options.threadName,
235
- },
236
- files: options.files,
237
- query: {
238
- wait: options.wait,
239
- thread_id: options.threadId,
240
- username: options.username,
241
- avatarURL: options.avatarURL,
242
- },
243
- })
244
- .then((response) => {
245
- if (response !== null) {
246
- return new Message(response, this.client);
247
- } else return null;
248
- });
249
- }
250
-
251
- /** https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook */
252
- async executeGitHubCompatible(options: {
253
- threadId?: string;
254
- wait?: boolean;
255
- }): Promise<Message | null> {
256
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
257
-
258
- return this.client.rest
259
- .post<RawMessage | null>(
260
- Endpoints.webhookPlatform(this.id, this.token, "github"),
261
- {
262
- query: {
263
- thread_id: options.threadId,
264
- wait: options.wait,
265
- },
266
- }
267
- )
268
- .then((response) => {
269
- if (response !== null) {
270
- return new Message(response, this.client);
271
- } else return null;
272
- });
273
- }
274
-
275
- /** https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook */
276
- async executeSlackCompatible(options: {
277
- threadId?: string;
278
- wait?: boolean;
279
- }): Promise<Message | null> {
280
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
281
-
282
- return this.client.rest
283
- .post<RawMessage | null>(
284
- Endpoints.webhookPlatform(this.id, this.token, "slack"),
285
- {
286
- query: {
287
- thread_id: options.threadId,
288
- wait: options.wait,
289
- },
290
- }
291
- )
292
- .then((response) => {
293
- if (response !== null) {
294
- return new Message(response, this.client);
295
- } else return null;
296
- });
297
- }
298
-
299
- /** https://discord.com/developers/docs/resources/webhook#get-webhook-message */
300
- async getMessage(
301
- messageId: string,
302
- options?: {
303
- threadId?: string;
304
- }
305
- ): Promise<Message> {
306
- if (!this.token) throw new Error("[disgroove] Webhook token not found");
307
-
308
- return new Message(
309
- await this.client.rest.get<RawMessage>(
310
- Endpoints.webhookMessage(this.id, this.token, messageId),
311
- {
312
- query: {
313
- thread_id: options?.threadId,
314
- },
315
- }
316
- ),
317
- this.client
318
- );
319
- }
320
-
321
- override toRaw(): RawWebhook {
322
- return this.raw;
323
- }
324
-
325
- override toJSON(): JSONWebhook {
326
- return {
327
- ...super.toJSON(),
328
- type: this.type,
329
- guildId: this.guildId,
330
- channelId: this.channelId,
331
- user: this.user?.toJSON(),
332
- name: this.name,
333
- avatar: this.avatar,
334
- token: this.token,
335
- applicationId: this.applicationId,
336
- sourceGuild: this.sourceGuild?.toJSON(),
337
- sourceChannel: this.sourceChannel?.toJSON(),
338
- url: this.url,
339
- };
340
- }
341
- }
@@ -1,27 +0,0 @@
1
- export * from "./Base";
2
- export * from "./Application";
3
- export * from "./ApplicationCommand";
4
- export * from "./AuditLog";
5
- export * from "./AutoModerationRule";
6
- export * from "./Channel";
7
- export * from "./ClientApplication";
8
- export * from "./Emoji";
9
- export * from "./Entitlement";
10
- export * from "./Guild";
11
- export * from "./GuildMember";
12
- export * from "./GuildScheduledEvent";
13
- export * from "./GuildTemplate";
14
- export * from "./Integration";
15
- export * from "./Interaction";
16
- export * from "./Invite";
17
- export * from "./Message";
18
- export * from "./Role";
19
- export * from "./SKU";
20
- export * from "./StageInstance";
21
- export * from "./Sticker";
22
- export * from "./Team";
23
- export * from "./TestEntitlement";
24
- export * from "./UnavailableGuild";
25
- export * from "./User";
26
- export * from "./VoiceState";
27
- export * from "./Webhook";
@@ -1,118 +0,0 @@
1
- import type {
2
- ApplicationCommandTypes,
3
- ApplicationCommandOptionType,
4
- ChannelTypes,
5
- Locale,
6
- ApplicationCommandPermissionType,
7
- } from "../constants";
8
-
9
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
10
- export interface RawApplicationCommand {
11
- id: string;
12
- type?: ApplicationCommandTypes;
13
- application_id: string;
14
- guild_id?: string;
15
- name: string;
16
- name_localizations?: Partial<Record<Locale, string>> | null;
17
- description: string;
18
- description_localizations?: Partial<Record<Locale, string>> | null;
19
- options?: Array<RawApplicationCommandOption>;
20
- default_member_permissions: string | null;
21
- dm_permission?: boolean;
22
- default_permission?: boolean | null;
23
- nsfw?: boolean;
24
- version: string;
25
- }
26
-
27
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */
28
- export interface RawApplicationCommandOption {
29
- type: ApplicationCommandOptionType;
30
- name: string;
31
- name_localizations?: Partial<Record<Locale, string>> | null;
32
- description: string;
33
- description_localizations?: Partial<Record<Locale, string>> | null;
34
- required?: boolean;
35
- choices?: Array<RawApplicationCommandOptionChoice>;
36
- options?: Array<RawApplicationCommandOption>;
37
- channel_types?: Array<ChannelTypes>;
38
- min_value?: number;
39
- max_value?: number;
40
- min_length?: number;
41
- max_length?: number;
42
- autocomplete?: boolean;
43
- }
44
-
45
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
46
- export interface RawApplicationCommandOptionChoice {
47
- name: string;
48
- name_localizations?: Partial<Record<Locale, string>> | null;
49
- value: string;
50
- }
51
-
52
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
53
- export interface RawGuildApplicationCommandPermissions {
54
- id: string;
55
- application_id: string;
56
- guild_id: string;
57
- permissions: Array<RawApplicationCommandPermission>;
58
- }
59
-
60
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */
61
- export interface RawApplicationCommandPermission {
62
- id: string;
63
- type: ApplicationCommandPermissionType;
64
- permission: boolean;
65
- }
66
-
67
- export interface JSONApplicationCommand {
68
- id: string;
69
- type?: ApplicationCommandTypes;
70
- applicationId: string;
71
- guildId?: string;
72
- name: string;
73
- nameLocalizations?: Partial<Record<Locale, string>> | null;
74
- description: string;
75
- descriptionLocalizations?: Partial<Record<Locale, string>> | null;
76
- options?: Array<JSONApplicationCommandOption>;
77
- defaultMemberPermissions: string | null;
78
- dmPermission?: boolean;
79
- defaultPermission?: boolean | null;
80
- nsfw?: boolean;
81
- version: string;
82
- }
83
-
84
- export interface JSONApplicationCommandOption {
85
- type: ApplicationCommandOptionType;
86
- name: string;
87
- nameLocalizations?: Partial<Record<Locale, string>> | null;
88
- description: string;
89
- descriptionLocalizations?: Partial<Record<Locale, string>> | null;
90
- required?: boolean;
91
- choices?: Array<JSONApplicationCommandOptionChoice>;
92
- options?: Array<JSONApplicationCommandOption>;
93
- channelTypes?: Array<ChannelTypes>;
94
- minValue?: number;
95
- maxValue?: number;
96
- minLength?: number;
97
- maxLength?: number;
98
- autocomplete?: boolean;
99
- }
100
-
101
- export interface JSONApplicationCommandOptionChoice {
102
- name: string;
103
- nameLocalizations?: Partial<Record<Locale, string>> | null;
104
- value: string;
105
- }
106
-
107
- export interface JSONGuildApplicationCommandPermissions {
108
- id: string;
109
- applicationId: string;
110
- guildId: string;
111
- permissions: Array<JSONApplicationCommandPermission>;
112
- }
113
-
114
- export interface JSONApplicationCommandPermission {
115
- id: string;
116
- type: ApplicationCommandPermissionType;
117
- permission: boolean;
118
- }
@@ -1,23 +0,0 @@
1
- import type {
2
- ApplicationRoleConnectionMetadataType,
3
- Locale,
4
- } from "../constants";
5
-
6
- /** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure */
7
- export interface RawApplicationRoleConnectionMetadata {
8
- type: ApplicationRoleConnectionMetadataType;
9
- key: string;
10
- name: string;
11
- name_localizations?: Partial<Record<Locale, string>> | null;
12
- description: string;
13
- description_localizations?: Partial<Record<Locale, string>> | null;
14
- }
15
-
16
- export interface JSONApplicationRoleConnectionMetadata {
17
- type: ApplicationRoleConnectionMetadataType;
18
- key: string;
19
- name: string;
20
- nameLocalizations?: Partial<Record<Locale, string>> | null;
21
- description: string;
22
- descriptionLocalizations?: Partial<Record<Locale, string>> | null;
23
- }
@@ -1,77 +0,0 @@
1
- import type {
2
- RawUser,
3
- RawTeam,
4
- JSONTeam,
5
- JSONUser,
6
- RawGuild,
7
- JSONGuild,
8
- } from ".";
9
- import type { ApplicationFlags, OAuth2Scopes } from "../constants";
10
-
11
- /** https://discord.com/developers/docs/resources/application#application-object-application-structure */
12
- export interface RawApplication {
13
- id: string;
14
- name: string;
15
- icon: string | null;
16
- description: string;
17
- rpc_origins?: Array<string>;
18
- bot_public: boolean;
19
- bot_require_code_grant: boolean;
20
- terms_of_service_url?: string;
21
- privacy_policy_url?: string;
22
- owner?: RawUser;
23
- verify_key: string;
24
- team: RawTeam | null;
25
- guild_id?: string;
26
- guild?: RawGuild;
27
- primary_sku_id?: string;
28
- slug?: string;
29
- cover_image?: string;
30
- flags?: ApplicationFlags;
31
- approximate_guild_count?: number;
32
- redirect_uris?: Array<string>;
33
- interactions_endpoint_url?: string;
34
- role_connections_verification_url?: string;
35
- tags?: Array<string>;
36
- install_params?: RawInstallParams;
37
- custom_install_url?: string;
38
- }
39
-
40
- /** https://discord.com/developers/docs/resources/application#install-params-object-install-params-structure */
41
- export interface RawInstallParams {
42
- scopes: Array<OAuth2Scopes>;
43
- permissions: string;
44
- }
45
-
46
- export interface JSONApplication {
47
- id: string;
48
- name: string;
49
- icon: string | null;
50
- description: string;
51
- rpcOrigins?: Array<string>;
52
- botPublic: boolean;
53
- botRequireCodeGrant: boolean;
54
- termsOfServiceURL?: string;
55
- privacyPolicyURL?: string;
56
- owner?: JSONUser;
57
- verifyKey: string;
58
- team: JSONTeam | null;
59
- guildId?: string;
60
- guild?: JSONGuild;
61
- primarySKUId?: string;
62
- slug?: string;
63
- coverImage?: string;
64
- flags?: ApplicationFlags;
65
- approximateGuildCount?: number;
66
- redirectURIs?: Array<string>;
67
- interactionsEndpointURL?: string;
68
- roleConnectionsVerificationURL?: string;
69
- tags?: Array<string>;
70
- installParams?: JSONInstallParams;
71
- customInstallURL?: string;
72
- }
73
-
74
- export interface JSONInstallParams {
75
- scopes: Array<OAuth2Scopes>;
76
- permissions: string;
77
- }
@@ -1,105 +0,0 @@
1
- import type {
2
- RawApplicationCommand,
3
- RawGuildScheduledEvent,
4
- RawAutoModerationRule,
5
- RawIntegration,
6
- RawChannel,
7
- RawUser,
8
- RawWebhook,
9
- JSONUser,
10
- JSONApplicationCommand,
11
- JSONAutoModerationRule,
12
- JSONGuildScheduledEvent,
13
- JSONIntegration,
14
- JSONChannel,
15
- JSONWebhook,
16
- } from ".";
17
- import type { AuditLogEvents } from "../constants";
18
-
19
- /** https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure */
20
- export interface RawAuditLog {
21
- application_commands: Array<RawApplicationCommand>;
22
- audit_log_entries: Array<RawAuditLogEntry>;
23
- auto_moderation_rules: Array<RawAutoModerationRule>;
24
- guild_scheduled_events: Array<RawGuildScheduledEvent>;
25
- integrations: Array<RawIntegration>;
26
- threads: Array<RawChannel>;
27
- users: Array<RawUser>;
28
- webhooks: Array<RawWebhook>;
29
- }
30
-
31
- /** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */
32
- export interface RawAuditLogEntry {
33
- target_id: string | null;
34
- changes?: Array<RawAuditLogChange>;
35
- user_id: string | null;
36
- id: string;
37
- action_type: AuditLogEvents;
38
- options?: RawOptionalAuditLogEntryInfo;
39
- reason?: string;
40
- }
41
-
42
- /** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */
43
- export interface RawOptionalAuditLogEntryInfo {
44
- application_id: string;
45
- auto_moderation_rule_name: string;
46
- auto_moderation_rule_trigger_type: string;
47
- channel_id: string;
48
- count: string;
49
- delete_member_days: string;
50
- id: string;
51
- members_removed: string;
52
- message_id: string;
53
- role_name: string;
54
- type: string;
55
- integration_type: string;
56
- }
57
-
58
- /** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
59
- export interface RawAuditLogChange {
60
- new_value?: any;
61
- old_value?: any;
62
- key: string;
63
- }
64
-
65
- export interface JSONAuditLog {
66
- applicationCommands: Array<JSONApplicationCommand>;
67
- auditLogEntries: Array<JSONAuditLogEntry>;
68
- autoModerationRules: Array<JSONAutoModerationRule>;
69
- guildScheduledEvents: Array<JSONGuildScheduledEvent>;
70
- integrations: Array<JSONIntegration>;
71
- threads: Array<JSONChannel>;
72
- users: Array<JSONUser>;
73
- webhooks: Array<JSONWebhook>;
74
- }
75
-
76
- export interface JSONAuditLogEntry {
77
- targetId: string | null;
78
- changes?: Array<JSONAuditLogChange>;
79
- userId: string | null;
80
- id: string;
81
- actionType: AuditLogEvents;
82
- options?: JSONOptionalAuditLogEntryInfo;
83
- reason?: string;
84
- }
85
-
86
- export interface JSONOptionalAuditLogEntryInfo {
87
- applicationId: string;
88
- autoModerationRuleName: string;
89
- autoModerationRuleTriggerType: string;
90
- channelId: string;
91
- count: string;
92
- deleteMemberDays: string;
93
- id: string;
94
- membersRemoved: string;
95
- messageId: string;
96
- roleName: string;
97
- type: string;
98
- integrationType: string;
99
- }
100
-
101
- export interface JSONAuditLogChange {
102
- newValue?: any;
103
- oldValue?: any;
104
- key: string;
105
- }