chapterjs 0.1.2 → 0.1.4
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/assets/asset.d.ts +46 -0
- package/dist/assets/asset.js +86 -0
- package/dist/assets/public.d.ts +19 -0
- package/dist/assets/public.js +120 -0
- package/dist/cache/cache.d.ts +62 -0
- package/dist/cache/cache.js +80 -0
- package/dist/cache/store.d.ts +45 -0
- package/dist/cache/store.js +53 -0
- package/dist/cli/build.d.ts +41 -0
- package/dist/cli/build.js +206 -0
- package/dist/cli/cli.js +108 -25
- package/dist/cli/cluster.d.ts +70 -0
- package/dist/cli/cluster.js +213 -0
- package/dist/cli/dev.d.ts +18 -1
- package/dist/cli/dev.js +252 -198
- package/dist/cli/env.d.ts +31 -0
- package/dist/cli/env.js +93 -0
- package/dist/cli/log.d.ts +13 -0
- package/dist/cli/log.js +17 -0
- package/dist/cli/node-version.d.ts +8 -0
- package/dist/cli/node-version.js +13 -0
- package/dist/cli/preflight.d.ts +36 -0
- package/dist/cli/preflight.js +122 -0
- package/dist/cli/project.d.ts +122 -0
- package/dist/cli/project.js +452 -0
- package/dist/cli/start.d.ts +25 -0
- package/dist/cli/start.js +225 -0
- package/dist/commands/autocomplete.d.ts +13 -0
- package/dist/commands/autocomplete.js +159 -0
- package/dist/commands/command.d.ts +346 -0
- package/dist/commands/command.js +28 -0
- package/dist/commands/convention.d.ts +64 -0
- package/dist/commands/convention.js +464 -0
- package/dist/commands/register.d.ts +18 -0
- package/dist/commands/register.js +42 -0
- package/dist/commands/router.d.ts +20 -0
- package/dist/commands/router.js +228 -0
- package/dist/commands/tree.d.ts +43 -0
- package/dist/commands/tree.js +206 -0
- package/dist/commands/twins.d.ts +15 -0
- package/dist/commands/twins.js +78 -0
- package/dist/components/button.d.ts +79 -0
- package/dist/components/button.js +108 -0
- package/dist/components/component.d.ts +140 -0
- package/dist/components/component.js +39 -0
- package/dist/components/convention.d.ts +35 -0
- package/dist/components/convention.js +339 -0
- package/dist/components/custom-id.d.ts +72 -0
- package/dist/components/custom-id.js +128 -0
- package/dist/components/embed.d.ts +28 -0
- package/dist/components/embed.js +11 -0
- package/dist/components/file.d.ts +30 -0
- package/dist/components/file.js +52 -0
- package/dist/components/instance.d.ts +100 -0
- package/dist/components/instance.js +86 -0
- package/dist/components/layout.d.ts +103 -0
- package/dist/components/layout.js +279 -0
- package/dist/components/modal.d.ts +244 -0
- package/dist/components/modal.js +399 -0
- package/dist/components/options.d.ts +41 -0
- package/dist/components/options.js +101 -0
- package/dist/components/render.d.ts +12 -0
- package/dist/components/render.js +58 -0
- package/dist/components/router.d.ts +18 -0
- package/dist/components/router.js +256 -0
- package/dist/components/select.d.ts +144 -0
- package/dist/components/select.js +179 -0
- package/dist/core/bot.d.ts +99 -0
- package/dist/core/bot.js +174 -0
- package/dist/core/memory.d.ts +66 -0
- package/dist/core/memory.js +115 -0
- package/dist/discord/api.d.ts +112 -0
- package/dist/discord/api.js +115 -0
- package/dist/discord/cdn.d.ts +67 -0
- package/dist/discord/cdn.js +100 -0
- package/dist/discord/codes.d.ts +171 -0
- package/dist/discord/codes.js +421 -0
- package/dist/discord/endpoint.d.ts +56 -0
- package/dist/discord/endpoint.js +53 -0
- package/dist/discord/endpoints.d.ts +1529 -0
- package/dist/discord/endpoints.js +1139 -0
- package/dist/discord/formatting.d.ts +67 -0
- package/dist/discord/formatting.js +87 -0
- package/dist/discord/index.d.ts +10 -0
- package/dist/discord/index.js +13 -0
- package/dist/discord/intents.d.ts +48 -0
- package/dist/discord/intents.js +128 -0
- package/dist/discord/permissions.d.ts +94 -0
- package/dist/discord/permissions.js +185 -0
- package/dist/discord/snowflake.d.ts +21 -0
- package/dist/discord/snowflake.js +36 -0
- package/dist/discord/types/application-command.d.ts +332 -0
- package/dist/discord/types/application-command.js +48 -0
- package/dist/discord/types/application-role-connection-metadata.d.ts +42 -0
- package/dist/discord/types/application-role-connection-metadata.js +22 -0
- package/dist/discord/types/application.d.ts +208 -0
- package/dist/discord/types/application.js +48 -0
- package/dist/discord/types/audit-log.d.ts +255 -0
- package/dist/discord/types/audit-log.js +144 -0
- package/dist/discord/types/auto-moderation.d.ts +167 -0
- package/dist/discord/types/auto-moderation.js +52 -0
- package/dist/discord/types/channel.d.ts +557 -0
- package/dist/discord/types/channel.js +88 -0
- package/dist/discord/types/common.d.ts +54 -0
- package/dist/discord/types/common.js +38 -0
- package/dist/discord/types/component.d.ts +775 -0
- package/dist/discord/types/component.js +76 -0
- package/dist/discord/types/emoji.d.ts +74 -0
- package/dist/discord/types/emoji.js +1 -0
- package/dist/discord/types/entitlement.d.ts +84 -0
- package/dist/discord/types/entitlement.js +22 -0
- package/dist/discord/types/gateway-events.d.ts +1148 -0
- package/dist/discord/types/gateway-events.js +54 -0
- package/dist/discord/types/gateway.d.ts +38 -0
- package/dist/discord/types/gateway.js +1 -0
- package/dist/discord/types/guild-scheduled-event.d.ts +257 -0
- package/dist/discord/types/guild-scheduled-event.js +68 -0
- package/dist/discord/types/guild-template.d.ts +51 -0
- package/dist/discord/types/guild-template.js +1 -0
- package/dist/discord/types/guild.d.ts +910 -0
- package/dist/discord/types/guild.js +153 -0
- package/dist/discord/types/index.d.ts +31 -0
- package/dist/discord/types/index.js +31 -0
- package/dist/discord/types/interaction.d.ts +321 -0
- package/dist/discord/types/interaction.js +47 -0
- package/dist/discord/types/invite.d.ts +158 -0
- package/dist/discord/types/invite.js +39 -0
- package/dist/discord/types/message.d.ts +834 -0
- package/dist/discord/types/message.js +159 -0
- package/dist/discord/types/oauth2.d.ts +22 -0
- package/dist/discord/types/oauth2.js +1 -0
- package/dist/discord/types/permissions.d.ts +183 -0
- package/dist/discord/types/permissions.js +118 -0
- package/dist/discord/types/poll.d.ts +106 -0
- package/dist/discord/types/poll.js +8 -0
- package/dist/discord/types/sku.d.ts +47 -0
- package/dist/discord/types/sku.js +26 -0
- package/dist/discord/types/soundboard.d.ts +71 -0
- package/dist/discord/types/soundboard.js +1 -0
- package/dist/discord/types/stage-instance.d.ts +58 -0
- package/dist/discord/types/stage-instance.js +10 -0
- package/dist/discord/types/sticker.d.ts +115 -0
- package/dist/discord/types/sticker.js +20 -0
- package/dist/discord/types/subscription.d.ts +54 -0
- package/dist/discord/types/subscription.js +12 -0
- package/dist/discord/types/team.d.ts +55 -0
- package/dist/discord/types/team.js +21 -0
- package/dist/discord/types/user.d.ts +273 -0
- package/dist/discord/types/user.js +83 -0
- package/dist/discord/types/voice.d.ts +72 -0
- package/dist/discord/types/voice.js +1 -0
- package/dist/discord/types/webhook.d.ts +184 -0
- package/dist/discord/types/webhook.js +12 -0
- package/dist/events/convention.d.ts +25 -0
- package/dist/events/convention.js +97 -0
- package/dist/events/event.d.ts +8 -0
- package/dist/events/event.js +20 -0
- package/dist/events/registry.d.ts +706 -0
- package/dist/events/registry.js +839 -0
- package/dist/events/router.d.ts +45 -0
- package/dist/events/router.js +133 -0
- package/dist/events/types.d.ts +7 -0
- package/dist/events/types.js +48 -0
- package/dist/gateway/errors.d.ts +18 -0
- package/dist/gateway/errors.js +47 -0
- package/dist/gateway/gateway.d.ts +64 -0
- package/dist/gateway/gateway.js +117 -0
- package/dist/gateway/identify-queue.d.ts +25 -0
- package/dist/gateway/identify-queue.js +29 -0
- package/dist/gateway/shard.d.ts +94 -0
- package/dist/gateway/shard.js +414 -0
- package/dist/gateway/state.d.ts +11 -0
- package/dist/gateway/state.js +184 -0
- package/dist/index.d.ts +55 -18
- package/dist/index.js +38 -12
- package/dist/interactions/cooldown.d.ts +33 -0
- package/dist/interactions/cooldown.js +74 -0
- package/dist/interactions/dispatch.d.ts +91 -0
- package/dist/interactions/dispatch.js +110 -0
- package/dist/loader/generated.d.ts +37 -0
- package/dist/loader/generated.js +114 -0
- package/dist/loader/hot.d.ts +13 -0
- package/dist/loader/hot.js +85 -0
- package/dist/loader/loader.d.ts +72 -0
- package/dist/loader/loader.js +135 -0
- package/dist/loader/locate.d.ts +10 -0
- package/dist/loader/locate.js +36 -0
- package/dist/loader/watch.d.ts +17 -0
- package/dist/loader/watch.js +66 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +6 -0
- package/dist/messages/commands.d.ts +23 -0
- package/dist/messages/commands.js +123 -0
- package/dist/messages/convention.d.ts +89 -0
- package/dist/messages/convention.js +347 -0
- package/dist/messages/messages.d.ts +219 -0
- package/dist/messages/messages.js +30 -0
- package/dist/messages/phrases.d.ts +23 -0
- package/dist/messages/phrases.js +44 -0
- package/dist/messages/translate.d.ts +100 -0
- package/dist/messages/translate.js +249 -0
- package/dist/presence/convention.d.ts +26 -0
- package/dist/presence/convention.js +133 -0
- package/dist/presence/presence.d.ts +57 -0
- package/dist/presence/presence.js +27 -0
- package/dist/rest/errors.d.ts +55 -0
- package/dist/rest/errors.js +92 -0
- package/dist/rest/rate-limiter.d.ts +46 -0
- package/dist/rest/rate-limiter.js +153 -0
- package/dist/rest/rest.d.ts +63 -0
- package/dist/rest/rest.js +194 -0
- package/dist/structures/base.d.ts +48 -0
- package/dist/structures/base.js +84 -0
- package/dist/structures/channel.d.ts +380 -0
- package/dist/structures/channel.js +627 -0
- package/dist/structures/context.d.ts +30 -0
- package/dist/structures/context.js +7 -0
- package/dist/structures/emoji.d.ts +46 -0
- package/dist/structures/emoji.js +65 -0
- package/dist/structures/entities.d.ts +62 -0
- package/dist/structures/entities.js +226 -0
- package/dist/structures/guild.d.ts +348 -0
- package/dist/structures/guild.js +466 -0
- package/dist/structures/interaction.d.ts +197 -0
- package/dist/structures/interaction.js +396 -0
- package/dist/structures/invite.d.ts +38 -0
- package/dist/structures/invite.js +57 -0
- package/dist/structures/known.d.ts +28 -0
- package/dist/structures/known.js +58 -0
- package/dist/structures/member.d.ts +140 -0
- package/dist/structures/member.js +260 -0
- package/dist/structures/message.d.ts +197 -0
- package/dist/structures/message.js +268 -0
- package/dist/structures/payload.d.ts +91 -0
- package/dist/structures/payload.js +184 -0
- package/dist/structures/role.d.ts +69 -0
- package/dist/structures/role.js +112 -0
- package/dist/structures/user.d.ts +59 -0
- package/dist/structures/user.js +94 -0
- package/dist/structures/webhook.d.ts +46 -0
- package/dist/structures/webhook.js +79 -0
- package/dist/tasks/convention.d.ts +26 -0
- package/dist/tasks/convention.js +78 -0
- package/dist/tasks/schedule.d.ts +54 -0
- package/dist/tasks/schedule.js +236 -0
- package/dist/tasks/scheduler.d.ts +33 -0
- package/dist/tasks/scheduler.js +107 -0
- package/dist/tasks/task.d.ts +76 -0
- package/dist/tasks/task.js +28 -0
- package/dist/util/case.d.ts +13 -0
- package/dist/util/case.js +54 -0
- package/dist/util/duration.d.ts +8 -0
- package/dist/util/duration.js +29 -0
- package/dist/util/websocket.d.ts +9 -0
- package/dist/util/websocket.js +31 -0
- package/dist/voice/connection.d.ts +90 -0
- package/dist/voice/connection.js +494 -0
- package/dist/voice/dave.d.ts +109 -0
- package/dist/voice/dave.js +245 -0
- package/dist/voice/opus.d.ts +19 -0
- package/dist/voice/opus.js +273 -0
- package/dist/voice/session.d.ts +55 -0
- package/dist/voice/session.js +405 -0
- package/dist/voice/source.d.ts +22 -0
- package/dist/voice/source.js +195 -0
- package/dist/voice/transport.d.ts +43 -0
- package/dist/voice/transport.js +140 -0
- package/dist/voice/usage.d.ts +4 -0
- package/dist/voice/usage.js +33 -0
- package/package.json +26 -7
- package/vendor/dave/LICENSE +231 -0
- package/vendor/dave/libdave.d.mts +99 -0
- package/vendor/dave/libdave.mjs +2 -0
- package/vendor/dave/libdave.wasm +0 -0
- package/dist/components.d.ts +0 -97
- package/dist/components.js +0 -260
- package/dist/context.d.ts +0 -72
- package/dist/context.js +0 -273
- package/dist/discord/client.d.ts +0 -35
- package/dist/discord/client.js +0 -66
- package/dist/discord/constants.d.ts +0 -49
- package/dist/discord/constants.js +0 -61
- package/dist/discord/events.d.ts +0 -129
- package/dist/discord/events.js +0 -102
- package/dist/discord/gateway.d.ts +0 -61
- package/dist/discord/gateway.js +0 -320
- package/dist/discord/payloads.d.ts +0 -275
- package/dist/discord/payloads.js +0 -3
- package/dist/discord/presence.d.ts +0 -42
- package/dist/discord/presence.js +0 -51
- package/dist/discord/rest.d.ts +0 -49
- package/dist/discord/rest.js +0 -271
- package/dist/discord/types.d.ts +0 -334
- package/dist/discord/types.js +0 -4
- package/dist/events.d.ts +0 -94
- package/dist/events.js +0 -255
- package/dist/presence.d.ts +0 -92
- package/dist/presence.js +0 -250
- package/dist/structures/Channel.d.ts +0 -110
- package/dist/structures/Channel.js +0 -171
- package/dist/structures/Guild.d.ts +0 -70
- package/dist/structures/Guild.js +0 -105
- package/dist/structures/Interaction.d.ts +0 -113
- package/dist/structures/Interaction.js +0 -274
- package/dist/structures/Member.d.ts +0 -70
- package/dist/structures/Member.js +0 -124
- package/dist/structures/Message.d.ts +0 -87
- package/dist/structures/Message.js +0 -182
- package/dist/structures/Reaction.d.ts +0 -38
- package/dist/structures/Reaction.js +0 -64
- package/dist/structures/Role.d.ts +0 -43
- package/dist/structures/Role.js +0 -77
- package/dist/structures/User.d.ts +0 -41
- package/dist/structures/User.js +0 -79
- package/dist/structures/utils.d.ts +0 -72
- package/dist/structures/utils.js +0 -59
- package/dist/utils/errors.d.ts +0 -5
- package/dist/utils/errors.js +0 -28
- package/dist/utils/modules.d.ts +0 -39
- package/dist/utils/modules.js +0 -156
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { Snowflake } from './common.js';
|
|
2
|
+
/**
|
|
3
|
+
* Auto Moderation Rule Structure
|
|
4
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure
|
|
5
|
+
*/
|
|
6
|
+
export interface RawAutoModerationRule {
|
|
7
|
+
/** the id of this rule */
|
|
8
|
+
id: Snowflake;
|
|
9
|
+
/** the id of the guild which this rule belongs to */
|
|
10
|
+
guild_id: Snowflake;
|
|
11
|
+
/** the rule name */
|
|
12
|
+
name: string;
|
|
13
|
+
/** the user which first created this rule */
|
|
14
|
+
creator_id: Snowflake;
|
|
15
|
+
/** the rule event type */
|
|
16
|
+
event_type: AutoModerationEventType;
|
|
17
|
+
/** the rule trigger type */
|
|
18
|
+
trigger_type: AutoModerationTriggerType;
|
|
19
|
+
/** the rule trigger metadata */
|
|
20
|
+
trigger_metadata: RawAutoModerationTriggerMetadata;
|
|
21
|
+
/** the actions which will execute when the rule is triggered */
|
|
22
|
+
actions: RawAutoModerationAction[];
|
|
23
|
+
/** whether the rule is enabled */
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
/** the role ids that should not be affected by the rule (Maximum of 20) */
|
|
26
|
+
exempt_roles: Snowflake[];
|
|
27
|
+
/** the channel ids that should not be affected by the rule (Maximum of 50) */
|
|
28
|
+
exempt_channels: Snowflake[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Trigger Types
|
|
32
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-trigger-types
|
|
33
|
+
*/
|
|
34
|
+
export declare const AutoModerationTriggerType: {
|
|
35
|
+
/** check if content contains words from a user defined list of keywords */
|
|
36
|
+
readonly Keyword: 1;
|
|
37
|
+
/** check if content represents generic spam */
|
|
38
|
+
readonly Spam: 3;
|
|
39
|
+
/** check if content contains words from internal pre-defined wordsets */
|
|
40
|
+
readonly KeywordPreset: 4;
|
|
41
|
+
/** check if content contains more unique mentions than allowed */
|
|
42
|
+
readonly MentionSpam: 5;
|
|
43
|
+
/** check if member profile contains words from a user defined list of keywords */
|
|
44
|
+
readonly MemberProfile: 6;
|
|
45
|
+
};
|
|
46
|
+
export type AutoModerationTriggerType = (typeof AutoModerationTriggerType)[keyof typeof AutoModerationTriggerType];
|
|
47
|
+
/**
|
|
48
|
+
* Trigger Metadata
|
|
49
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata
|
|
50
|
+
*/
|
|
51
|
+
export interface RawAutoModerationTriggerMetadata {
|
|
52
|
+
/** substrings which will be searched for in content (Maximum of 1000) */
|
|
53
|
+
keyword_filter?: string[];
|
|
54
|
+
/** regular expression patterns which will be matched against content (Maximum of 10) */
|
|
55
|
+
regex_patterns?: string[];
|
|
56
|
+
/** the internally pre-defined wordsets which will be searched for in content */
|
|
57
|
+
presets?: AutoModerationKeywordPresetType[];
|
|
58
|
+
/** substrings which should not trigger the rule (Maximum of 100 or 1000) */
|
|
59
|
+
allow_list?: string[];
|
|
60
|
+
/** total number of unique role and user mentions allowed per message (Maximum of 50) */
|
|
61
|
+
mention_total_limit?: number;
|
|
62
|
+
/** whether to automatically detect mention raids */
|
|
63
|
+
mention_raid_protection_enabled?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Keyword Preset Types
|
|
67
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types
|
|
68
|
+
*/
|
|
69
|
+
export declare const AutoModerationKeywordPresetType: {
|
|
70
|
+
/** words that may be considered forms of swearing or cursing */
|
|
71
|
+
readonly Profanity: 1;
|
|
72
|
+
/** words that refer to sexually explicit behavior or activity */
|
|
73
|
+
readonly SexualContent: 2;
|
|
74
|
+
/** personal insults or words that may be considered hate speech */
|
|
75
|
+
readonly Slurs: 3;
|
|
76
|
+
};
|
|
77
|
+
export type AutoModerationKeywordPresetType = (typeof AutoModerationKeywordPresetType)[keyof typeof AutoModerationKeywordPresetType];
|
|
78
|
+
/**
|
|
79
|
+
* Event Types
|
|
80
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-event-types
|
|
81
|
+
*/
|
|
82
|
+
export declare const AutoModerationEventType: {
|
|
83
|
+
/** when a member sends or edits a message in the guild */
|
|
84
|
+
readonly MessageSend: 1;
|
|
85
|
+
/** when a member edits their profile */
|
|
86
|
+
readonly MemberUpdate: 2;
|
|
87
|
+
};
|
|
88
|
+
export type AutoModerationEventType = (typeof AutoModerationEventType)[keyof typeof AutoModerationEventType];
|
|
89
|
+
/**
|
|
90
|
+
* Auto Moderation Action Structure
|
|
91
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-action-object-auto-moderation-action-structure
|
|
92
|
+
*/
|
|
93
|
+
export interface RawAutoModerationAction {
|
|
94
|
+
/** the type of action */
|
|
95
|
+
type: AutoModerationActionType;
|
|
96
|
+
/** additional metadata needed during execution for this specific action type */
|
|
97
|
+
metadata?: RawAutoModerationActionMetadata;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Action Types
|
|
101
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-action-object-action-types
|
|
102
|
+
*/
|
|
103
|
+
export declare const AutoModerationActionType: {
|
|
104
|
+
/** blocks a member's message and prevents it from being posted. A custom explanation can be specified and shown to members whenever their message is blocked. */
|
|
105
|
+
readonly BlockMessage: 1;
|
|
106
|
+
/** logs user content to a specified channel */
|
|
107
|
+
readonly SendAlertMessage: 2;
|
|
108
|
+
/** timeout user for a specified duration * */
|
|
109
|
+
readonly Timeout: 3;
|
|
110
|
+
/** prevents a member from using text, voice, or other interactions */
|
|
111
|
+
readonly BlockMemberInteraction: 4;
|
|
112
|
+
};
|
|
113
|
+
export type AutoModerationActionType = (typeof AutoModerationActionType)[keyof typeof AutoModerationActionType];
|
|
114
|
+
/**
|
|
115
|
+
* Action Metadata
|
|
116
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-action-object-action-metadata
|
|
117
|
+
*/
|
|
118
|
+
export interface RawAutoModerationActionMetadata {
|
|
119
|
+
/** channel to which user content should be logged */
|
|
120
|
+
channel_id?: Snowflake;
|
|
121
|
+
/** timeout duration in seconds */
|
|
122
|
+
duration_seconds?: number;
|
|
123
|
+
/** additional explanation that will be shown to members whenever their message is blocked */
|
|
124
|
+
custom_message?: string | null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* JSON Params
|
|
128
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#create-auto-moderation-rule-json-params
|
|
129
|
+
*/
|
|
130
|
+
export interface CreateAutoModerationRuleJSONParams {
|
|
131
|
+
/** the rule name */
|
|
132
|
+
name: string;
|
|
133
|
+
/** the event type */
|
|
134
|
+
event_type: AutoModerationEventType;
|
|
135
|
+
/** the trigger type */
|
|
136
|
+
trigger_type: AutoModerationTriggerType;
|
|
137
|
+
/** the trigger metadata */
|
|
138
|
+
trigger_metadata?: RawAutoModerationTriggerMetadata;
|
|
139
|
+
/** the actions which will execute when the rule is triggered */
|
|
140
|
+
actions: RawAutoModerationAction[];
|
|
141
|
+
/** whether the rule is enabled (False by default) */
|
|
142
|
+
enabled?: boolean;
|
|
143
|
+
/** the role ids that should not be affected by the rule (Maximum of 20) */
|
|
144
|
+
exempt_roles?: Snowflake[];
|
|
145
|
+
/** the channel ids that should not be affected by the rule (Maximum of 50) */
|
|
146
|
+
exempt_channels?: Snowflake[];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* JSON Params
|
|
150
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#modify-auto-moderation-rule-json-params
|
|
151
|
+
*/
|
|
152
|
+
export interface ModifyAutoModerationRuleJSONParams {
|
|
153
|
+
/** the rule name */
|
|
154
|
+
name?: string;
|
|
155
|
+
/** the event type */
|
|
156
|
+
event_type?: AutoModerationEventType;
|
|
157
|
+
/** the trigger metadata */
|
|
158
|
+
trigger_metadata?: RawAutoModerationTriggerMetadata;
|
|
159
|
+
/** the actions which will execute when the rule is triggered */
|
|
160
|
+
actions?: RawAutoModerationAction[];
|
|
161
|
+
/** whether the rule is enabled */
|
|
162
|
+
enabled?: boolean;
|
|
163
|
+
/** the role ids that should not be affected by the rule (Maximum of 20) */
|
|
164
|
+
exempt_roles?: Snowflake[];
|
|
165
|
+
/** the channel ids that should not be affected by the rule (Maximum of 50) */
|
|
166
|
+
exempt_channels?: Snowflake[];
|
|
167
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trigger Types
|
|
3
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-trigger-types
|
|
4
|
+
*/
|
|
5
|
+
export const AutoModerationTriggerType = {
|
|
6
|
+
/** check if content contains words from a user defined list of keywords */
|
|
7
|
+
Keyword: 1,
|
|
8
|
+
/** check if content represents generic spam */
|
|
9
|
+
Spam: 3,
|
|
10
|
+
/** check if content contains words from internal pre-defined wordsets */
|
|
11
|
+
KeywordPreset: 4,
|
|
12
|
+
/** check if content contains more unique mentions than allowed */
|
|
13
|
+
MentionSpam: 5,
|
|
14
|
+
/** check if member profile contains words from a user defined list of keywords */
|
|
15
|
+
MemberProfile: 6,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Keyword Preset Types
|
|
19
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types
|
|
20
|
+
*/
|
|
21
|
+
export const AutoModerationKeywordPresetType = {
|
|
22
|
+
/** words that may be considered forms of swearing or cursing */
|
|
23
|
+
Profanity: 1,
|
|
24
|
+
/** words that refer to sexually explicit behavior or activity */
|
|
25
|
+
SexualContent: 2,
|
|
26
|
+
/** personal insults or words that may be considered hate speech */
|
|
27
|
+
Slurs: 3,
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Event Types
|
|
31
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-event-types
|
|
32
|
+
*/
|
|
33
|
+
export const AutoModerationEventType = {
|
|
34
|
+
/** when a member sends or edits a message in the guild */
|
|
35
|
+
MessageSend: 1,
|
|
36
|
+
/** when a member edits their profile */
|
|
37
|
+
MemberUpdate: 2,
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Action Types
|
|
41
|
+
* @see https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-action-object-action-types
|
|
42
|
+
*/
|
|
43
|
+
export const AutoModerationActionType = {
|
|
44
|
+
/** blocks a member's message and prevents it from being posted. A custom explanation can be specified and shown to members whenever their message is blocked. */
|
|
45
|
+
BlockMessage: 1,
|
|
46
|
+
/** logs user content to a specified channel */
|
|
47
|
+
SendAlertMessage: 2,
|
|
48
|
+
/** timeout user for a specified duration * */
|
|
49
|
+
Timeout: 3,
|
|
50
|
+
/** prevents a member from using text, voice, or other interactions */
|
|
51
|
+
BlockMemberInteraction: 4,
|
|
52
|
+
};
|