disgroove 2.2.2-dev.bd3875c → 2.2.2
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/README.md +2 -6
- package/dist/lib/Client.d.ts +47 -49
- package/dist/lib/Client.js +170 -182
- package/dist/lib/constants.d.ts +19 -4
- package/dist/lib/constants.js +22 -5
- package/dist/lib/gateway/Shard.js +59 -58
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/rest/Endpoints.d.ts +6 -6
- package/dist/lib/rest/Endpoints.js +13 -13
- package/dist/lib/rest/RequestManager.d.ts +1 -1
- package/dist/lib/rest/index.d.ts +0 -1
- package/dist/lib/rest/index.js +1 -2
- package/dist/lib/transformers/Applications.d.ts +8 -0
- package/dist/lib/transformers/Applications.js +211 -0
- package/dist/lib/transformers/AuditLogs.d.ts +7 -0
- package/dist/lib/transformers/AuditLogs.js +97 -0
- package/dist/lib/transformers/AutoModeration.d.ts +5 -0
- package/dist/lib/transformers/AutoModeration.js +64 -0
- package/dist/lib/transformers/Channels.d.ts +16 -0
- package/dist/lib/transformers/Channels.js +676 -0
- package/dist/lib/transformers/Emojis.d.ts +5 -0
- package/dist/lib/transformers/Emojis.js +31 -0
- package/dist/lib/transformers/Entitlements.d.ts +7 -0
- package/dist/lib/transformers/Entitlements.js +58 -0
- package/dist/lib/transformers/GuildScheduledEvents.d.ts +5 -0
- package/dist/lib/transformers/GuildScheduledEvents.js +51 -0
- package/dist/lib/transformers/GuildTemplates.d.ts +5 -0
- package/dist/lib/transformers/GuildTemplates.js +38 -0
- package/dist/lib/transformers/Guilds.d.ts +12 -0
- package/dist/lib/transformers/Guilds.js +248 -0
- package/dist/lib/transformers/Interactions.d.ts +10 -0
- package/dist/lib/transformers/Interactions.js +273 -0
- package/dist/lib/transformers/Invites.d.ts +5 -0
- package/dist/lib/transformers/Invites.js +79 -0
- package/dist/lib/transformers/Polls.d.ts +5 -0
- package/dist/lib/transformers/Polls.js +50 -0
- package/dist/lib/transformers/Presences.d.ts +8 -0
- package/dist/lib/transformers/Presences.js +108 -0
- package/dist/lib/transformers/Roles.d.ts +5 -0
- package/dist/lib/transformers/Roles.js +56 -0
- package/dist/lib/transformers/SKUs.d.ts +5 -0
- package/dist/lib/transformers/SKUs.js +26 -0
- package/dist/lib/transformers/StageInstances.d.ts +5 -0
- package/dist/lib/transformers/StageInstances.js +28 -0
- package/dist/lib/transformers/Stickers.d.ts +5 -0
- package/dist/lib/transformers/Stickers.js +41 -0
- package/dist/lib/transformers/Teams.d.ts +5 -0
- package/dist/lib/transformers/Teams.js +35 -0
- package/dist/lib/transformers/Users.d.ts +5 -0
- package/dist/lib/transformers/Users.js +48 -0
- package/dist/lib/transformers/Voice.d.ts +5 -0
- package/dist/lib/transformers/Voice.js +45 -0
- package/dist/lib/transformers/Webhooks.d.ts +5 -0
- package/dist/lib/transformers/Webhooks.js +51 -0
- package/dist/lib/transformers/index.d.ts +21 -0
- package/dist/lib/transformers/index.js +37 -0
- package/dist/lib/types/entitlements.d.ts +0 -6
- package/dist/lib/types/interaction.d.ts +2 -2
- package/dist/lib/types/sku.d.ts +0 -12
- package/dist/lib/utils/CDN.d.ts +24 -0
- package/dist/lib/utils/CDN.js +49 -0
- package/dist/lib/utils/Util.d.ts +1 -93
- package/dist/lib/utils/Util.js +2 -2211
- package/dist/lib/utils/formatters.d.ts +9 -0
- package/dist/lib/utils/formatters.js +38 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.js +15 -0
- package/dist/package.json +3 -3
- package/package.json +3 -3
- package/dist/lib/rest/CDN.d.ts +0 -22
- package/dist/lib/rest/CDN.js +0 -45
- package/dist/lib/types/voice-connections.d.ts +0 -64
- package/dist/lib/types/voice-connections.js +0 -2
- package/dist/lib/voice/VoiceConnection.d.ts +0 -57
- package/dist/lib/voice/VoiceConnection.js +0 -150
- package/dist/lib/voice/VoiceConnectionManager.d.ts +0 -19
- package/dist/lib/voice/VoiceConnectionManager.js +0 -66
- package/dist/lib/voice/index.d.ts +0 -2
- package/dist/lib/voice/index.js +0 -18
@@ -0,0 +1,211 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Applications = void 0;
|
4
|
+
const Guilds_1 = require("./Guilds");
|
5
|
+
const Teams_1 = require("./Teams");
|
6
|
+
const Users_1 = require("./Users");
|
7
|
+
class Applications {
|
8
|
+
static applicationCommandFromRaw(applicationCommand) {
|
9
|
+
return {
|
10
|
+
id: applicationCommand.id,
|
11
|
+
type: applicationCommand.type,
|
12
|
+
applicationID: applicationCommand.application_id,
|
13
|
+
guildID: applicationCommand.guild_id,
|
14
|
+
name: applicationCommand.name,
|
15
|
+
nameLocalizations: applicationCommand.name_localizations,
|
16
|
+
description: applicationCommand.description,
|
17
|
+
descriptionLocalizations: applicationCommand.description_localizations,
|
18
|
+
options: applicationCommand.options?.map((option) => ({
|
19
|
+
type: option.type,
|
20
|
+
name: option.name,
|
21
|
+
name_localizations: option.name_localizations,
|
22
|
+
description: option.description,
|
23
|
+
description_localizations: option.description_localizations,
|
24
|
+
required: option.required,
|
25
|
+
choices: option.choices?.map((choice) => ({
|
26
|
+
name: choice.name,
|
27
|
+
name_localizations: choice.name_localizations,
|
28
|
+
value: choice.value,
|
29
|
+
})),
|
30
|
+
options: option.options?.map((o) => ({
|
31
|
+
type: o.type,
|
32
|
+
name: o.name,
|
33
|
+
name_localizations: o.name_localizations,
|
34
|
+
description: o.description,
|
35
|
+
description_localizations: o.description_localizations,
|
36
|
+
required: o.required,
|
37
|
+
choices: o.choices?.map((choice) => ({
|
38
|
+
name: choice.name,
|
39
|
+
name_localizations: choice.name_localizations,
|
40
|
+
value: choice.value,
|
41
|
+
})),
|
42
|
+
channel_types: o.channel_types,
|
43
|
+
min_value: o.min_value,
|
44
|
+
max_value: o.max_value,
|
45
|
+
min_length: o.min_length,
|
46
|
+
max_length: o.max_length,
|
47
|
+
autocomplete: o.autocomplete,
|
48
|
+
})),
|
49
|
+
channel_types: option.channel_types,
|
50
|
+
min_value: option.min_value,
|
51
|
+
max_value: option.max_value,
|
52
|
+
min_length: option.min_length,
|
53
|
+
max_length: option.max_length,
|
54
|
+
autocomplete: option.autocomplete,
|
55
|
+
})),
|
56
|
+
defaultMemberPermissions: applicationCommand.default_member_permissions,
|
57
|
+
dmPermission: applicationCommand.dm_permission,
|
58
|
+
defaultPermission: applicationCommand.default_permission,
|
59
|
+
integrationTypes: applicationCommand.integration_types,
|
60
|
+
contexts: applicationCommand.contexts,
|
61
|
+
nsfw: applicationCommand.nsfw,
|
62
|
+
version: applicationCommand.version,
|
63
|
+
};
|
64
|
+
}
|
65
|
+
static applicationCommandToRaw(applicationCommand) {
|
66
|
+
return {
|
67
|
+
id: applicationCommand.id,
|
68
|
+
type: applicationCommand.type,
|
69
|
+
application_id: applicationCommand.applicationID,
|
70
|
+
guild_id: applicationCommand.guildID,
|
71
|
+
name: applicationCommand.name,
|
72
|
+
name_localizations: applicationCommand.nameLocalizations,
|
73
|
+
description: applicationCommand.description,
|
74
|
+
description_localizations: applicationCommand.descriptionLocalizations,
|
75
|
+
options: applicationCommand.options?.map((option) => ({
|
76
|
+
type: option.type,
|
77
|
+
name: option.name,
|
78
|
+
name_localizations: option.nameLocalizations,
|
79
|
+
description: option.description,
|
80
|
+
description_localizations: option.descriptionLocalizations,
|
81
|
+
required: option.required,
|
82
|
+
choices: option.choices?.map((choice) => ({
|
83
|
+
name: choice.name,
|
84
|
+
name_localizations: choice.nameLocalizations,
|
85
|
+
value: choice.value,
|
86
|
+
})),
|
87
|
+
options: option.options?.map((o) => ({
|
88
|
+
type: o.type,
|
89
|
+
name: o.name,
|
90
|
+
name_localizations: o.nameLocalizations,
|
91
|
+
description: o.description,
|
92
|
+
description_localizations: o.descriptionLocalizations,
|
93
|
+
required: o.required,
|
94
|
+
choices: o.choices?.map((choice) => ({
|
95
|
+
name: choice.name,
|
96
|
+
name_localizations: choice.nameLocalizations,
|
97
|
+
value: choice.value,
|
98
|
+
})),
|
99
|
+
channel_types: o.channelTypes,
|
100
|
+
min_value: o.minValue,
|
101
|
+
max_value: o.maxValue,
|
102
|
+
min_length: o.minLength,
|
103
|
+
max_length: o.maxLength,
|
104
|
+
autocomplete: o.autocomplete,
|
105
|
+
})),
|
106
|
+
channel_types: option.channelTypes,
|
107
|
+
min_value: option.minValue,
|
108
|
+
max_value: option.maxValue,
|
109
|
+
min_length: option.minLength,
|
110
|
+
max_length: option.maxLength,
|
111
|
+
autocomplete: option.autocomplete,
|
112
|
+
})),
|
113
|
+
default_member_permissions: applicationCommand.defaultMemberPermissions,
|
114
|
+
dm_permission: applicationCommand.dmPermission,
|
115
|
+
default_permission: applicationCommand.defaultPermission,
|
116
|
+
integration_types: applicationCommand.integrationTypes,
|
117
|
+
contexts: applicationCommand.contexts,
|
118
|
+
nsfw: applicationCommand.nsfw,
|
119
|
+
version: applicationCommand.version,
|
120
|
+
};
|
121
|
+
}
|
122
|
+
static applicationFromRaw(application) {
|
123
|
+
return {
|
124
|
+
id: application.id,
|
125
|
+
name: application.name,
|
126
|
+
icon: application.icon,
|
127
|
+
description: application.description,
|
128
|
+
rpcOrigins: application.rpc_origins,
|
129
|
+
botPublic: application.bot_public,
|
130
|
+
botRequireCodeGrant: application.bot_require_code_grant,
|
131
|
+
termsOfServiceURL: application.terms_of_service_url,
|
132
|
+
privacyPolicyURL: application.privacy_policy_url,
|
133
|
+
owner: application.owner !== undefined
|
134
|
+
? Users_1.Users.userFromRaw(application.owner)
|
135
|
+
: undefined,
|
136
|
+
verifyKey: application.verify_key,
|
137
|
+
team: application.team !== null ? Teams_1.Teams.teamFromRaw(application.team) : null,
|
138
|
+
guildID: application.guild_id,
|
139
|
+
guild: application.guild !== undefined
|
140
|
+
? Guilds_1.Guilds.guildFromRaw(application.guild)
|
141
|
+
: undefined,
|
142
|
+
primarySKUID: application.primary_sku_id,
|
143
|
+
slug: application.slug,
|
144
|
+
coverImage: application.cover_image,
|
145
|
+
flags: application.flags,
|
146
|
+
approximateGuildCount: application.approximate_guild_count,
|
147
|
+
redirectURIs: application.redirect_uris,
|
148
|
+
interactionsEndpointURL: application.interactions_endpoint_url,
|
149
|
+
roleConnectionsVerificationURL: application.role_connections_verification_url,
|
150
|
+
tags: application.tags,
|
151
|
+
installParams: application.install_params,
|
152
|
+
integrationTypesConfig: application.integration_types_config !== undefined
|
153
|
+
? {
|
154
|
+
"0": {
|
155
|
+
oauth2InstallParams: application.integration_types_config?.[0]
|
156
|
+
.oauth2_install_params,
|
157
|
+
},
|
158
|
+
"1": {
|
159
|
+
oauth2InstallParams: application.integration_types_config?.[1]
|
160
|
+
.oauth2_install_params,
|
161
|
+
},
|
162
|
+
}
|
163
|
+
: undefined,
|
164
|
+
customInstallURL: application.custom_install_url,
|
165
|
+
};
|
166
|
+
}
|
167
|
+
static applicationToRaw(application) {
|
168
|
+
return {
|
169
|
+
id: application.id,
|
170
|
+
name: application.name,
|
171
|
+
icon: application.icon,
|
172
|
+
description: application.description,
|
173
|
+
rpc_origins: application.rpcOrigins,
|
174
|
+
bot_public: application.botPublic,
|
175
|
+
bot_require_code_grant: application.botRequireCodeGrant,
|
176
|
+
terms_of_service_url: application.termsOfServiceURL,
|
177
|
+
privacy_policy_url: application.privacyPolicyURL,
|
178
|
+
owner: application.owner !== undefined
|
179
|
+
? Users_1.Users.userToRaw(application.owner)
|
180
|
+
: undefined,
|
181
|
+
verify_key: application.verifyKey,
|
182
|
+
team: application.team !== null ? Teams_1.Teams.teamToRaw(application.team) : null,
|
183
|
+
guild_id: application.guildID,
|
184
|
+
guild: application.guild !== undefined
|
185
|
+
? Guilds_1.Guilds.guildToRaw(application.guild)
|
186
|
+
: undefined,
|
187
|
+
primary_sku_id: application.primarySKUID,
|
188
|
+
slug: application.slug,
|
189
|
+
cover_image: application.coverImage,
|
190
|
+
flags: application.flags,
|
191
|
+
approximate_guild_count: application.approximateGuildCount,
|
192
|
+
redirect_uris: application.redirectURIs,
|
193
|
+
interactions_endpoint_url: application.interactionsEndpointURL,
|
194
|
+
role_connections_verification_url: application.roleConnectionsVerificationURL,
|
195
|
+
tags: application.tags,
|
196
|
+
install_params: application.installParams,
|
197
|
+
integration_types_config: application.integrationTypesConfig !== undefined
|
198
|
+
? {
|
199
|
+
"0": {
|
200
|
+
oauth2_install_params: application.integrationTypesConfig?.[0].oauth2InstallParams,
|
201
|
+
},
|
202
|
+
"1": {
|
203
|
+
oauth2_install_params: application.integrationTypesConfig?.[1].oauth2InstallParams,
|
204
|
+
},
|
205
|
+
}
|
206
|
+
: undefined,
|
207
|
+
custom_install_url: application.customInstallURL,
|
208
|
+
};
|
209
|
+
}
|
210
|
+
}
|
211
|
+
exports.Applications = Applications;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { RawAuditLogEntry, AuditLogEntry, RawAuditLog, AuditLog } from "../types/audit-log";
|
2
|
+
export declare class AuditLogs {
|
3
|
+
static auditLogEntryFromRaw(auditLogEntry: RawAuditLogEntry): AuditLogEntry;
|
4
|
+
static auditLogEntryToRaw(auditLogEntry: AuditLogEntry): RawAuditLogEntry;
|
5
|
+
static auditLogFromRaw(auditLog: RawAuditLog): AuditLog;
|
6
|
+
static auditLogToRaw(auditLog: AuditLog): RawAuditLog;
|
7
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AuditLogs = void 0;
|
4
|
+
const Applications_1 = require("./Applications");
|
5
|
+
const AutoModeration_1 = require("./AutoModeration");
|
6
|
+
const Channels_1 = require("./Channels");
|
7
|
+
const Guilds_1 = require("./Guilds");
|
8
|
+
const GuildScheduledEvents_1 = require("./GuildScheduledEvents");
|
9
|
+
const Users_1 = require("./Users");
|
10
|
+
const Webhooks_1 = require("./Webhooks");
|
11
|
+
class AuditLogs {
|
12
|
+
static auditLogEntryFromRaw(auditLogEntry) {
|
13
|
+
return {
|
14
|
+
targetID: auditLogEntry.target_id,
|
15
|
+
changes: auditLogEntry.changes?.map((auditLogChange) => ({
|
16
|
+
newValue: auditLogChange.new_value,
|
17
|
+
oldValue: auditLogChange.old_value,
|
18
|
+
key: auditLogChange.key,
|
19
|
+
})),
|
20
|
+
userID: auditLogEntry.user_id,
|
21
|
+
id: auditLogEntry.id,
|
22
|
+
actionType: auditLogEntry.action_type,
|
23
|
+
options: auditLogEntry.options !== undefined
|
24
|
+
? {
|
25
|
+
applicationID: auditLogEntry.options.application_id,
|
26
|
+
autoModerationRuleName: auditLogEntry.options.auto_moderation_rule_name,
|
27
|
+
autoModerationRuleTriggerType: auditLogEntry.options.auto_moderation_rule_trigger_type,
|
28
|
+
channelID: auditLogEntry.options.channel_id,
|
29
|
+
count: auditLogEntry.options.count,
|
30
|
+
deleteMemberDays: auditLogEntry.options.delete_member_days,
|
31
|
+
id: auditLogEntry.options.id,
|
32
|
+
membersRemoved: auditLogEntry.options.members_removed,
|
33
|
+
messageID: auditLogEntry.options.message_id,
|
34
|
+
roleName: auditLogEntry.options.role_name,
|
35
|
+
type: auditLogEntry.options.type,
|
36
|
+
integrationType: auditLogEntry.options.integration_type,
|
37
|
+
}
|
38
|
+
: undefined,
|
39
|
+
reason: auditLogEntry.reason,
|
40
|
+
};
|
41
|
+
}
|
42
|
+
static auditLogEntryToRaw(auditLogEntry) {
|
43
|
+
return {
|
44
|
+
target_id: auditLogEntry.targetID,
|
45
|
+
changes: auditLogEntry.changes?.map((auditLogChange) => ({
|
46
|
+
new_value: auditLogChange.newValue,
|
47
|
+
old_value: auditLogChange.oldValue,
|
48
|
+
key: auditLogChange.key,
|
49
|
+
})),
|
50
|
+
user_id: auditLogEntry.userID,
|
51
|
+
id: auditLogEntry.id,
|
52
|
+
action_type: auditLogEntry.actionType,
|
53
|
+
options: auditLogEntry.options !== undefined
|
54
|
+
? {
|
55
|
+
application_id: auditLogEntry.options.applicationID,
|
56
|
+
auto_moderation_rule_name: auditLogEntry.options.autoModerationRuleName,
|
57
|
+
auto_moderation_rule_trigger_type: auditLogEntry.options.autoModerationRuleTriggerType,
|
58
|
+
channel_id: auditLogEntry.options.channelID,
|
59
|
+
count: auditLogEntry.options.count,
|
60
|
+
delete_member_days: auditLogEntry.options.deleteMemberDays,
|
61
|
+
id: auditLogEntry.options.id,
|
62
|
+
members_removed: auditLogEntry.options.membersRemoved,
|
63
|
+
message_id: auditLogEntry.options.messageID,
|
64
|
+
role_name: auditLogEntry.options.roleName,
|
65
|
+
type: auditLogEntry.options.type,
|
66
|
+
integration_type: auditLogEntry.options.integrationType,
|
67
|
+
}
|
68
|
+
: undefined,
|
69
|
+
reason: auditLogEntry.reason,
|
70
|
+
};
|
71
|
+
}
|
72
|
+
static auditLogFromRaw(auditLog) {
|
73
|
+
return {
|
74
|
+
applicationCommands: auditLog.application_commands.map((applicationCommand) => Applications_1.Applications.applicationCommandFromRaw(applicationCommand)),
|
75
|
+
auditLogEntries: auditLog.audit_log_entries.map((auditLogEntry) => AuditLogs.auditLogEntryFromRaw(auditLogEntry)),
|
76
|
+
autoModerationRules: auditLog.auto_moderation_rules.map((autoModerationRule) => AutoModeration_1.AutoModeration.autoModerationRuleFromRaw(autoModerationRule)),
|
77
|
+
guildScheduledEvents: auditLog.guild_scheduled_events.map((guildScheduledEvent) => GuildScheduledEvents_1.GuildScheduledEvents.guildScheduledEventFromRaw(guildScheduledEvent)),
|
78
|
+
integrations: auditLog.integrations.map((integration) => Guilds_1.Guilds.integrationFromRaw(integration)),
|
79
|
+
threads: auditLog.threads.map((thread) => Channels_1.Channels.channelFromRaw(thread)),
|
80
|
+
users: auditLog.users.map((user) => Users_1.Users.userFromRaw(user)),
|
81
|
+
webhooks: auditLog.webhooks.map((webhook) => Webhooks_1.Webhooks.webhookFromRaw(webhook)),
|
82
|
+
};
|
83
|
+
}
|
84
|
+
static auditLogToRaw(auditLog) {
|
85
|
+
return {
|
86
|
+
application_commands: auditLog.applicationCommands.map((applicationCommand) => Applications_1.Applications.applicationCommandToRaw(applicationCommand)),
|
87
|
+
audit_log_entries: auditLog.auditLogEntries.map((auditLogEntry) => AuditLogs.auditLogEntryToRaw(auditLogEntry)),
|
88
|
+
auto_moderation_rules: auditLog.autoModerationRules.map((autoModerationRule) => AutoModeration_1.AutoModeration.autoModerationRuleToRaw(autoModerationRule)),
|
89
|
+
guild_scheduled_events: auditLog.guildScheduledEvents.map((guildScheduledEvent) => GuildScheduledEvents_1.GuildScheduledEvents.guildScheduledEventToRaw(guildScheduledEvent)),
|
90
|
+
integrations: auditLog.integrations.map((integration) => Guilds_1.Guilds.integrationToRaw(integration)),
|
91
|
+
threads: auditLog.threads.map((thread) => Channels_1.Channels.channelToRaw(thread)),
|
92
|
+
users: auditLog.users.map((user) => Users_1.Users.userToRaw(user)),
|
93
|
+
webhooks: auditLog.webhooks.map((webhook) => Webhooks_1.Webhooks.webhookToRaw(webhook)),
|
94
|
+
};
|
95
|
+
}
|
96
|
+
}
|
97
|
+
exports.AuditLogs = AuditLogs;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { AutoModerationRule, RawAutoModerationRule } from "../types/auto-moderation";
|
2
|
+
export declare class AutoModeration {
|
3
|
+
static autoModerationRuleFromRaw(autoModerationRule: RawAutoModerationRule): AutoModerationRule;
|
4
|
+
static autoModerationRuleToRaw(autoModerationRule: AutoModerationRule): RawAutoModerationRule;
|
5
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AutoModeration = void 0;
|
4
|
+
class AutoModeration {
|
5
|
+
static autoModerationRuleFromRaw(autoModerationRule) {
|
6
|
+
return {
|
7
|
+
id: autoModerationRule.id,
|
8
|
+
guildID: autoModerationRule.guild_id,
|
9
|
+
name: autoModerationRule.name,
|
10
|
+
creatorID: autoModerationRule.creator_id,
|
11
|
+
eventType: autoModerationRule.event_type,
|
12
|
+
triggerType: autoModerationRule.trigger_type,
|
13
|
+
triggerMetadata: {
|
14
|
+
keywordFilter: autoModerationRule.trigger_metadata.keyword_filter,
|
15
|
+
regexPatterns: autoModerationRule.trigger_metadata.regex_patterns,
|
16
|
+
presets: autoModerationRule.trigger_metadata.presets,
|
17
|
+
allowList: autoModerationRule.trigger_metadata.allow_list,
|
18
|
+
mentionTotalLimit: autoModerationRule.trigger_metadata.mention_total_limit,
|
19
|
+
mentionRaidProtection: autoModerationRule.trigger_metadata.mention_raid_protection,
|
20
|
+
},
|
21
|
+
actions: autoModerationRule.actions.map((action) => ({
|
22
|
+
type: action.type,
|
23
|
+
metadata: {
|
24
|
+
channelID: action.metadata.channel_id,
|
25
|
+
durationSeconds: action.metadata.duration_seconds,
|
26
|
+
customMessage: action.metadata.custom_message,
|
27
|
+
},
|
28
|
+
})),
|
29
|
+
enabled: autoModerationRule.enabled,
|
30
|
+
exemptRoles: autoModerationRule.exempt_roles,
|
31
|
+
exemptChannels: autoModerationRule.exempt_channels,
|
32
|
+
};
|
33
|
+
}
|
34
|
+
static autoModerationRuleToRaw(autoModerationRule) {
|
35
|
+
return {
|
36
|
+
id: autoModerationRule.id,
|
37
|
+
guild_id: autoModerationRule.guildID,
|
38
|
+
name: autoModerationRule.name,
|
39
|
+
creator_id: autoModerationRule.creatorID,
|
40
|
+
event_type: autoModerationRule.eventType,
|
41
|
+
trigger_type: autoModerationRule.triggerType,
|
42
|
+
trigger_metadata: {
|
43
|
+
keyword_filter: autoModerationRule.triggerMetadata.keywordFilter,
|
44
|
+
regex_patterns: autoModerationRule.triggerMetadata.regexPatterns,
|
45
|
+
presets: autoModerationRule.triggerMetadata.presets,
|
46
|
+
allow_list: autoModerationRule.triggerMetadata.allowList,
|
47
|
+
mention_total_limit: autoModerationRule.triggerMetadata.mentionTotalLimit,
|
48
|
+
mention_raid_protection: autoModerationRule.triggerMetadata.mentionRaidProtection,
|
49
|
+
},
|
50
|
+
actions: autoModerationRule.actions.map((action) => ({
|
51
|
+
type: action.type,
|
52
|
+
metadata: {
|
53
|
+
channel_id: action.metadata.channelID,
|
54
|
+
duration_seconds: action.metadata.durationSeconds,
|
55
|
+
custom_message: action.metadata.customMessage,
|
56
|
+
},
|
57
|
+
})),
|
58
|
+
enabled: autoModerationRule.enabled,
|
59
|
+
exempt_roles: autoModerationRule.exemptRoles,
|
60
|
+
exempt_channels: autoModerationRule.exemptChannels,
|
61
|
+
};
|
62
|
+
}
|
63
|
+
}
|
64
|
+
exports.AutoModeration = AutoModeration;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { RawAttachment, Attachment, RawChannel, Channel, RawEmbed, Embed, RawMessage, Message, RawThreadMember, ThreadMember } from "../types/channel";
|
2
|
+
import type { RawActionRow, ActionRow } from "../types/message-components";
|
3
|
+
export declare class Channels {
|
4
|
+
static attachmentFromRaw(attachment: RawAttachment): Attachment;
|
5
|
+
static attachmentToRaw(attachment: Attachment): RawAttachment;
|
6
|
+
static channelFromRaw(channel: RawChannel): Channel;
|
7
|
+
static channelToRaw(channel: Channel): RawChannel;
|
8
|
+
static componentsFromRaw(components: Array<RawActionRow>): Array<ActionRow>;
|
9
|
+
static componentsToRaw(components: Array<ActionRow>): Array<RawActionRow>;
|
10
|
+
static embedFromRaw(embed: RawEmbed): Embed;
|
11
|
+
static embedToRaw(embed: Embed): RawEmbed;
|
12
|
+
static messageFromRaw(message: RawMessage): Message;
|
13
|
+
static messageToRaw(message: Message): RawMessage;
|
14
|
+
static threadMemberFromRaw(threadMember: RawThreadMember): ThreadMember;
|
15
|
+
static threadMemberToRaw(threadMember: ThreadMember): RawThreadMember;
|
16
|
+
}
|