seyfert 5.2.2-dev-40764380528.0 → 5.2.2-dev-41044135868.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/shorters/guilds.d.ts +2 -1
- package/lib/common/shorters/guilds.js +2 -1
- package/lib/common/shorters/roles.d.ts +2 -1
- package/lib/common/shorters/roles.js +3 -1
- package/lib/events/hooks/guild.d.ts +1 -0
- package/lib/structures/Guild.d.ts +2 -2
- package/lib/structures/GuildRole.d.ts +1 -1
- package/lib/structures/GuildRole.js +1 -1
- package/lib/structures/channels.d.ts +1 -1
- package/lib/structures/channels.js +1 -1
- package/lib/types/payloads/auditLog.d.ts +23 -1
- package/lib/types/payloads/auditLog.js +10 -0
- package/lib/types/rest/guild.d.ts +5 -5
- package/package.json +1 -1
|
@@ -190,8 +190,9 @@ export declare class GuildShorter extends BaseShorter {
|
|
|
190
190
|
* Edits the positions of channels in the guild.
|
|
191
191
|
* @param guildId The ID of the guild.
|
|
192
192
|
* @param body The data containing the new positions of channels.
|
|
193
|
+
* @param reason The reason for reordering the channels, shown in the audit log.
|
|
193
194
|
*/
|
|
194
|
-
editPositions: (guildId: string, body: RESTPatchAPIGuildChannelPositionsJSONBody) => Promise<undefined>;
|
|
195
|
+
editPositions: (guildId: string, body: RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string) => Promise<undefined>;
|
|
195
196
|
addFollower: (channelId: string, webhook_channel_id: string, reason?: string) => Promise<RESTPostAPIChannelFollowersResult>;
|
|
196
197
|
};
|
|
197
198
|
/**
|
|
@@ -328,8 +328,9 @@ class GuildShorter extends base_1.BaseShorter {
|
|
|
328
328
|
* Edits the positions of channels in the guild.
|
|
329
329
|
* @param guildId The ID of the guild.
|
|
330
330
|
* @param body The data containing the new positions of channels.
|
|
331
|
+
* @param reason The reason for reordering the channels, shown in the audit log.
|
|
331
332
|
*/
|
|
332
|
-
editPositions: (guildId, body) => this.client.proxy.guilds(guildId).channels.patch({ body }),
|
|
333
|
+
editPositions: (guildId, body, reason) => this.client.proxy.guilds(guildId).channels.patch({ body, reason }),
|
|
333
334
|
addFollower: async (channelId, webhook_channel_id, reason) => {
|
|
334
335
|
return this.client.proxy.channels(channelId).followers.post({
|
|
335
336
|
body: {
|
|
@@ -47,7 +47,8 @@ export declare class RoleShorter extends BaseShorter {
|
|
|
47
47
|
* Edits the positions of roles in the guild.
|
|
48
48
|
* @param guildId The ID of the guild.
|
|
49
49
|
* @param body The data to update the positions of roles with.
|
|
50
|
+
* @param reason The reason for reordering the roles, shown in the audit log.
|
|
50
51
|
* @returns A Promise that resolves to an array of edited roles.
|
|
51
52
|
*/
|
|
52
|
-
editPositions(guildId: string, body: RESTPatchAPIGuildRolePositionsJSONBody): Promise<GuildRoleStructure[]>;
|
|
53
|
+
editPositions(guildId: string, body: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string): Promise<GuildRoleStructure[]>;
|
|
53
54
|
}
|
|
@@ -90,11 +90,13 @@ class RoleShorter extends base_1.BaseShorter {
|
|
|
90
90
|
* Edits the positions of roles in the guild.
|
|
91
91
|
* @param guildId The ID of the guild.
|
|
92
92
|
* @param body The data to update the positions of roles with.
|
|
93
|
+
* @param reason The reason for reordering the roles, shown in the audit log.
|
|
93
94
|
* @returns A Promise that resolves to an array of edited roles.
|
|
94
95
|
*/
|
|
95
|
-
async editPositions(guildId, body) {
|
|
96
|
+
async editPositions(guildId, body, reason) {
|
|
96
97
|
const roles = await this.client.proxy.guilds(guildId).roles.patch({
|
|
97
98
|
body,
|
|
99
|
+
reason,
|
|
98
100
|
});
|
|
99
101
|
if (!this.client.cache.hasRolesIntent) {
|
|
100
102
|
await this.client.cache.roles?.set(cache_1.CacheFrom.Rest, roles.map(x => [x.id, x]), guildId);
|
|
@@ -424,6 +424,7 @@ export declare const GUILD_AUDIT_LOG_ENTRY_CREATE: (_self: UsingClient, data: Ga
|
|
|
424
424
|
guildId: string;
|
|
425
425
|
id: string;
|
|
426
426
|
options?: {
|
|
427
|
+
applicationId?: string | undefined;
|
|
427
428
|
autoModerationRuleName?: string | undefined;
|
|
428
429
|
autoModerationRuleTriggerType?: "1" | "3" | "4" | "5" | "6" | undefined;
|
|
429
430
|
channelId?: string | undefined;
|
|
@@ -61,7 +61,7 @@ export declare class Guild<State extends StructStates = 'api'> extends Guild_bas
|
|
|
61
61
|
list: (force?: boolean) => Promise<import("..").GuildRoleStructure[]>;
|
|
62
62
|
edit: (roleId: string, body: import("..").RESTPatchAPIGuildRoleJSONBody, reason?: string) => Promise<import("..").GuildRoleStructure>;
|
|
63
63
|
delete: (roleId: string, reason?: string) => Promise<void>;
|
|
64
|
-
editPositions: (body: import("..").RESTPatchAPIGuildRolePositionsJSONBody) => Promise<import("..").GuildRoleStructure[]>;
|
|
64
|
+
editPositions: (body: import("..").RESTPatchAPIGuildRolePositionsJSONBody, reason?: string) => Promise<import("..").GuildRoleStructure[]>;
|
|
65
65
|
memberCounts: () => Promise<import("..").RESTGetAPIGuildRoleMemberCountsResult>;
|
|
66
66
|
};
|
|
67
67
|
channels: {
|
|
@@ -72,7 +72,7 @@ export declare class Guild<State extends StructStates = 'api'> extends Guild_bas
|
|
|
72
72
|
}) => Promise<import("..").SeyfertChannelMap[T]>;
|
|
73
73
|
delete: (id: string, reason?: string) => Promise<import("./channels").AllChannels>;
|
|
74
74
|
edit: (id: string, body: import("..").RESTPatchAPIChannelJSONBody, reason?: string) => Promise<import("./channels").AllChannels>;
|
|
75
|
-
editPositions: (body: import("..").RESTPatchAPIGuildChannelPositionsJSONBody) => Promise<undefined>;
|
|
75
|
+
editPositions: (body: import("..").RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string) => Promise<undefined>;
|
|
76
76
|
};
|
|
77
77
|
emojis: {
|
|
78
78
|
edit: (emojiId: string, body: import("..").RESTPatchAPIGuildEmojiJSONBody, reason?: string) => Promise<import("..").GuildEmojiStructure>;
|
|
@@ -37,7 +37,7 @@ export declare class GuildRole extends DiscordBase {
|
|
|
37
37
|
list: (force?: boolean) => Promise<GuildRoleStructure[]>;
|
|
38
38
|
edit: (roleId: string, body: RESTPatchAPIGuildRoleJSONBody, reason?: string) => Promise<GuildRoleStructure>;
|
|
39
39
|
delete: (roleId: string, reason?: string) => Promise<void>;
|
|
40
|
-
editPositions: (body: RESTPatchAPIGuildRolePositionsJSONBody) => Promise<GuildRoleStructure[]>;
|
|
40
|
+
editPositions: (body: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string) => Promise<GuildRoleStructure[]>;
|
|
41
41
|
memberCounts: () => Promise<RESTGetAPIGuildRoleMemberCountsResult>;
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -60,7 +60,7 @@ class GuildRole extends DiscordBase_1.DiscordBase {
|
|
|
60
60
|
list: (force = false) => ctx.client.roles.list(ctx.guildId, force),
|
|
61
61
|
edit: (roleId, body, reason) => ctx.client.roles.edit(ctx.guildId, roleId, body, reason),
|
|
62
62
|
delete: (roleId, reason) => ctx.client.roles.delete(ctx.guildId, roleId, reason),
|
|
63
|
-
editPositions: (body) => ctx.client.roles.editPositions(ctx.guildId, body),
|
|
63
|
+
editPositions: (body, reason) => ctx.client.roles.editPositions(ctx.guildId, body, reason),
|
|
64
64
|
memberCounts: () => ctx.client.roles.memberCounts(ctx.guildId),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
@@ -50,7 +50,7 @@ export declare class BaseNoEditableChannel<T extends ChannelType> extends Discor
|
|
|
50
50
|
}) => Promise<SeyfertChannelMap[T]>;
|
|
51
51
|
delete: (id: string, reason?: string) => Promise<AllChannels>;
|
|
52
52
|
edit: (id: string, body: RESTPatchAPIChannelJSONBody, reason?: string) => Promise<AllChannels>;
|
|
53
|
-
editPositions: (body: RESTPatchAPIGuildChannelPositionsJSONBody) => Promise<undefined>;
|
|
53
|
+
editPositions: (body: RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string) => Promise<undefined>;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
export declare class BaseChannel<T extends ChannelType> extends BaseNoEditableChannel<T> {
|
|
@@ -95,7 +95,7 @@ class BaseNoEditableChannel extends DiscordBase_1.DiscordBase {
|
|
|
95
95
|
create: (body) => ctx.client.guilds.channels.create(ctx.guildId, body),
|
|
96
96
|
delete: (id, reason) => ctx.client.guilds.channels.delete(ctx.guildId, id, reason),
|
|
97
97
|
edit: (id, body, reason) => ctx.client.guilds.channels.edit(ctx.guildId, id, body, reason),
|
|
98
|
-
editPositions: (body) => ctx.client.guilds.channels.editPositions(ctx.guildId, body),
|
|
98
|
+
editPositions: (body, reason) => ctx.client.guilds.channels.editPositions(ctx.guildId, body, reason),
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -110,6 +110,13 @@ export interface APIAuditLogEntry {
|
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* https://docs.discord.com/developers/resources/audit-log#audit-log-entry-object-audit-log-events
|
|
113
|
+
*
|
|
114
|
+
* `MESSAGE_DELETE`, `MESSAGE_BULK_DELETE`, `MEMBER_DISCONNECT`, `MEMBER_MOVE`, `CHANNEL_POSITION_UPDATE`
|
|
115
|
+
* and `ROLE_POSITION_UPDATE` entries are merged when the same user repeats the action in quick succession.
|
|
116
|
+
* The original entry is updated in place, only the first request's reason is kept, and the updates do not
|
|
117
|
+
* dispatch another `GUILD_AUDIT_LOG_ENTRY_CREATE` event.
|
|
118
|
+
*
|
|
119
|
+
* See https://docs.discord.com/developers/resources/audit-log#audit-log-entry-object-audit-log-entry-merging
|
|
113
120
|
*/
|
|
114
121
|
export declare enum AuditLogEvent {
|
|
115
122
|
GuildUpdate = 1,
|
|
@@ -119,6 +126,7 @@ export declare enum AuditLogEvent {
|
|
|
119
126
|
ChannelOverwriteCreate = 13,
|
|
120
127
|
ChannelOverwriteUpdate = 14,
|
|
121
128
|
ChannelOverwriteDelete = 15,
|
|
129
|
+
ChannelPositionUpdate = 16,
|
|
122
130
|
MemberKick = 20,
|
|
123
131
|
MemberPrune = 21,
|
|
124
132
|
MemberBanAdd = 22,
|
|
@@ -131,6 +139,7 @@ export declare enum AuditLogEvent {
|
|
|
131
139
|
RoleCreate = 30,
|
|
132
140
|
RoleUpdate = 31,
|
|
133
141
|
RoleDelete = 32,
|
|
142
|
+
RolePositionUpdate = 33,
|
|
134
143
|
InviteCreate = 40,
|
|
135
144
|
InviteUpdate = 41,
|
|
136
145
|
InviteDelete = 42,
|
|
@@ -169,6 +178,7 @@ export declare enum AuditLogEvent {
|
|
|
169
178
|
AutoModerationBlockMessage = 143,
|
|
170
179
|
AutoModerationFlagToChannel = 144,
|
|
171
180
|
AutoModerationUserCommunicationDisabled = 145,
|
|
181
|
+
AutoModerationQuarantineUser = 146,
|
|
172
182
|
CreatorMonetizationRequestCreated = 150,
|
|
173
183
|
CreatorMonetizationTermsAccepted = 151,
|
|
174
184
|
OnboardingPromptCreate = 163,
|
|
@@ -187,6 +197,13 @@ export declare enum AuditLogEvent {
|
|
|
187
197
|
* https://docs.discord.com/developers/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
|
188
198
|
*/
|
|
189
199
|
export interface APIAuditLogOptions {
|
|
200
|
+
/**
|
|
201
|
+
* ID of the app whose permissions were targeted
|
|
202
|
+
*
|
|
203
|
+
* Present from:
|
|
204
|
+
* - APPLICATION_COMMAND_PERMISSION_UPDATE
|
|
205
|
+
*/
|
|
206
|
+
application_id?: Snowflake;
|
|
190
207
|
/**
|
|
191
208
|
* Name of the Auto Moderation rule that was triggered
|
|
192
209
|
*
|
|
@@ -194,6 +211,7 @@ export interface APIAuditLogOptions {
|
|
|
194
211
|
* - AUTO_MODERATION_BLOCK_MESSAGE
|
|
195
212
|
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
|
196
213
|
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
|
214
|
+
* - AUTO_MODERATION_QUARANTINE_USER
|
|
197
215
|
*/
|
|
198
216
|
auto_moderation_rule_name?: string;
|
|
199
217
|
/**
|
|
@@ -203,6 +221,7 @@ export interface APIAuditLogOptions {
|
|
|
203
221
|
* - AUTO_MODERATION_BLOCK_MESSAGE
|
|
204
222
|
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
|
205
223
|
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
|
224
|
+
* - AUTO_MODERATION_QUARANTINE_USER
|
|
206
225
|
*/
|
|
207
226
|
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
|
|
208
227
|
/**
|
|
@@ -233,6 +252,7 @@ export interface APIAuditLogOptions {
|
|
|
233
252
|
* - AUTO_MODERATION_BLOCK_MESSAGE
|
|
234
253
|
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
|
235
254
|
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
|
255
|
+
* - AUTO_MODERATION_QUARANTINE_USER
|
|
236
256
|
*/
|
|
237
257
|
channel_id?: Snowflake;
|
|
238
258
|
/**
|
|
@@ -244,13 +264,15 @@ export interface APIAuditLogOptions {
|
|
|
244
264
|
*/
|
|
245
265
|
message_id?: Snowflake;
|
|
246
266
|
/**
|
|
247
|
-
* Number of entities that were targeted
|
|
267
|
+
* Number of entities that were targeted, or number of position updates
|
|
248
268
|
*
|
|
249
269
|
* Present from:
|
|
250
270
|
* - MESSAGE_DELETE
|
|
251
271
|
* - MESSAGE_BULK_DELETE
|
|
252
272
|
* - MEMBER_DISCONNECT
|
|
253
273
|
* - MEMBER_MOVE
|
|
274
|
+
* - CHANNEL_POSITION_UPDATE
|
|
275
|
+
* - ROLE_POSITION_UPDATE
|
|
254
276
|
*/
|
|
255
277
|
count?: string;
|
|
256
278
|
/**
|
|
@@ -6,6 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.AuditLogOptionsType = exports.AuditLogEvent = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* https://docs.discord.com/developers/resources/audit-log#audit-log-entry-object-audit-log-events
|
|
9
|
+
*
|
|
10
|
+
* `MESSAGE_DELETE`, `MESSAGE_BULK_DELETE`, `MEMBER_DISCONNECT`, `MEMBER_MOVE`, `CHANNEL_POSITION_UPDATE`
|
|
11
|
+
* and `ROLE_POSITION_UPDATE` entries are merged when the same user repeats the action in quick succession.
|
|
12
|
+
* The original entry is updated in place, only the first request's reason is kept, and the updates do not
|
|
13
|
+
* dispatch another `GUILD_AUDIT_LOG_ENTRY_CREATE` event.
|
|
14
|
+
*
|
|
15
|
+
* See https://docs.discord.com/developers/resources/audit-log#audit-log-entry-object-audit-log-entry-merging
|
|
9
16
|
*/
|
|
10
17
|
var AuditLogEvent;
|
|
11
18
|
(function (AuditLogEvent) {
|
|
@@ -16,6 +23,7 @@ var AuditLogEvent;
|
|
|
16
23
|
AuditLogEvent[AuditLogEvent["ChannelOverwriteCreate"] = 13] = "ChannelOverwriteCreate";
|
|
17
24
|
AuditLogEvent[AuditLogEvent["ChannelOverwriteUpdate"] = 14] = "ChannelOverwriteUpdate";
|
|
18
25
|
AuditLogEvent[AuditLogEvent["ChannelOverwriteDelete"] = 15] = "ChannelOverwriteDelete";
|
|
26
|
+
AuditLogEvent[AuditLogEvent["ChannelPositionUpdate"] = 16] = "ChannelPositionUpdate";
|
|
19
27
|
AuditLogEvent[AuditLogEvent["MemberKick"] = 20] = "MemberKick";
|
|
20
28
|
AuditLogEvent[AuditLogEvent["MemberPrune"] = 21] = "MemberPrune";
|
|
21
29
|
AuditLogEvent[AuditLogEvent["MemberBanAdd"] = 22] = "MemberBanAdd";
|
|
@@ -28,6 +36,7 @@ var AuditLogEvent;
|
|
|
28
36
|
AuditLogEvent[AuditLogEvent["RoleCreate"] = 30] = "RoleCreate";
|
|
29
37
|
AuditLogEvent[AuditLogEvent["RoleUpdate"] = 31] = "RoleUpdate";
|
|
30
38
|
AuditLogEvent[AuditLogEvent["RoleDelete"] = 32] = "RoleDelete";
|
|
39
|
+
AuditLogEvent[AuditLogEvent["RolePositionUpdate"] = 33] = "RolePositionUpdate";
|
|
31
40
|
AuditLogEvent[AuditLogEvent["InviteCreate"] = 40] = "InviteCreate";
|
|
32
41
|
AuditLogEvent[AuditLogEvent["InviteUpdate"] = 41] = "InviteUpdate";
|
|
33
42
|
AuditLogEvent[AuditLogEvent["InviteDelete"] = 42] = "InviteDelete";
|
|
@@ -66,6 +75,7 @@ var AuditLogEvent;
|
|
|
66
75
|
AuditLogEvent[AuditLogEvent["AutoModerationBlockMessage"] = 143] = "AutoModerationBlockMessage";
|
|
67
76
|
AuditLogEvent[AuditLogEvent["AutoModerationFlagToChannel"] = 144] = "AutoModerationFlagToChannel";
|
|
68
77
|
AuditLogEvent[AuditLogEvent["AutoModerationUserCommunicationDisabled"] = 145] = "AutoModerationUserCommunicationDisabled";
|
|
78
|
+
AuditLogEvent[AuditLogEvent["AutoModerationQuarantineUser"] = 146] = "AutoModerationQuarantineUser";
|
|
69
79
|
AuditLogEvent[AuditLogEvent["CreatorMonetizationRequestCreated"] = 150] = "CreatorMonetizationRequestCreated";
|
|
70
80
|
AuditLogEvent[AuditLogEvent["CreatorMonetizationTermsAccepted"] = 151] = "CreatorMonetizationTermsAccepted";
|
|
71
81
|
AuditLogEvent[AuditLogEvent["OnboardingPromptCreate"] = 163] = "OnboardingPromptCreate";
|
|
@@ -279,13 +279,13 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = {
|
|
|
279
279
|
*/
|
|
280
280
|
id: Snowflake;
|
|
281
281
|
/**
|
|
282
|
-
* Sorting position of the channel
|
|
282
|
+
* Sorting position of the channel (channels with the same position are sorted by id)
|
|
283
283
|
*/
|
|
284
|
-
position
|
|
284
|
+
position?: number | null | undefined;
|
|
285
285
|
/**
|
|
286
286
|
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
|
287
287
|
*/
|
|
288
|
-
lock_permissions?: boolean | undefined;
|
|
288
|
+
lock_permissions?: boolean | null | undefined;
|
|
289
289
|
/**
|
|
290
290
|
* The new parent id of this channel
|
|
291
291
|
*/
|
|
@@ -594,9 +594,9 @@ export type RESTPatchAPIGuildRolePositionsJSONBody = {
|
|
|
594
594
|
*/
|
|
595
595
|
id: Snowflake;
|
|
596
596
|
/**
|
|
597
|
-
* Sorting position of the role
|
|
597
|
+
* Sorting position of the role (roles with the same position are sorted by id)
|
|
598
598
|
*/
|
|
599
|
-
position?: number | undefined;
|
|
599
|
+
position?: number | null | undefined;
|
|
600
600
|
}[];
|
|
601
601
|
/**
|
|
602
602
|
* https://docs.discord.com/developers/resources/guild#modify-guild-role-positions
|