-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathAuditLogOptions.ts
More file actions
100 lines (88 loc) · 2.19 KB
/
AuditLogOptions.ts
File metadata and controls
100 lines (88 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import type { APIAuditLogOptions } from 'discord-api-types/v10';
import { Structure } from '../Structure';
import { kData } from '../utils/symbols';
import type { Partialize } from '../utils/types';
/**
* Represents the audit log options on Discord.
*
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
*/
export class AuditLogOptions<Omitted extends keyof APIAuditLogOptions | '' = ''> extends Structure<
APIAuditLogOptions,
Omitted
> {
/**
* @param data - The raw data received from the API for the audit log options.
*/
public constructor(data: Partialize<APIAuditLogOptions, Omitted>) {
super(data);
}
/**
* Name of the auto moderation rule that was triggered.
*/
public get autoModerationRuleName() {
return this[kData].auto_moderation_rule_name;
}
/**
* Trigger type of the auto moderation rule that was triggered.
*/
public get autoModerationRuleTriggerType() {
return this[kData].auto_moderation_rule_trigger_type;
}
/**
* The id of the channel in which the entities were targeted.
*/
public get channelId() {
return this[kData].channel_id;
}
/**
* The number of entities that were targeted.
*/
public get count() {
return this[kData].count;
}
/**
* Number of days after which inactive members were kicked.
*/
public get deleteMemberDays() {
return this[kData].delete_member_days;
}
/**
* The id of the overwritten entity.
*/
public get id() {
return this[kData].id;
}
/**
* The number of members removed by the prune.
*/
public get membersRemoved() {
return this[kData].members_removed;
}
/**
* The id of the message that was targeted.
*/
public get messageId() {
return this[kData].message_id;
}
/**
* Name of the role.
*
* @remarks Only present if the {@link AuditLogOptions.type} is set to `0`
*/
public get roleName() {
return this[kData].role_name;
}
/**
* The type of overwritten entity - `"0"` for `role` or `"1"` for `member`
*/
public get type() {
return this[kData].type;
}
/**
* The type of integration which performed the action.
*/
public get integrationType() {
return this[kData].integration_type;
}
}