mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
feat(AutoModeration): v13 support customMessage (#9173)
* feat: add customMessage * chore: use main wording
This commit is contained in:
@@ -74,6 +74,7 @@ class AutoModerationRuleManager extends CachedManager {
|
|||||||
* @typedef {Object} AutoModerationActionMetadataOptions
|
* @typedef {Object} AutoModerationActionMetadataOptions
|
||||||
* @property {GuildTextChannelResolvable|ThreadChannel} [channel] The channel to which content will be logged
|
* @property {GuildTextChannelResolvable|ThreadChannel} [channel] The channel to which content will be logged
|
||||||
* @property {number} [durationSeconds] The timeout duration in seconds
|
* @property {number} [durationSeconds] The timeout duration in seconds
|
||||||
|
* @property {string} [customMessage] The custom message that is shown whenever a message is blocked
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -131,6 +132,7 @@ class AutoModerationRuleManager extends CachedManager {
|
|||||||
metadata: {
|
metadata: {
|
||||||
duration_seconds: action.metadata?.durationSeconds,
|
duration_seconds: action.metadata?.durationSeconds,
|
||||||
channel_id: action.metadata?.channel && this.guild.channels.resolveId(action.metadata.channel),
|
channel_id: action.metadata?.channel && this.guild.channels.resolveId(action.metadata.channel),
|
||||||
|
custom_message: action.metadata?.customMessage,
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
enabled,
|
enabled,
|
||||||
@@ -192,6 +194,7 @@ class AutoModerationRuleManager extends CachedManager {
|
|||||||
metadata: {
|
metadata: {
|
||||||
duration_seconds: action.metadata?.durationSeconds,
|
duration_seconds: action.metadata?.durationSeconds,
|
||||||
channel_id: action.metadata?.channel && this.guild.channels.resolveId(action.metadata.channel),
|
channel_id: action.metadata?.channel && this.guild.channels.resolveId(action.metadata.channel),
|
||||||
|
custom_message: action.metadata?.customMessage,
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
enabled,
|
enabled,
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ class AutoModerationRule extends Base {
|
|||||||
* @typedef {Object} AutoModerationActionMetadata
|
* @typedef {Object} AutoModerationActionMetadata
|
||||||
* @property {?Snowflake} channelId The id of the channel to which content will be logged
|
* @property {?Snowflake} channelId The id of the channel to which content will be logged
|
||||||
* @property {?number} durationSeconds The timeout duration in seconds
|
* @property {?number} durationSeconds The timeout duration in seconds
|
||||||
|
* @property {?string} customMessage The custom message that is shown whenever a message is blocked
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,6 +113,7 @@ class AutoModerationRule extends Base {
|
|||||||
metadata: {
|
metadata: {
|
||||||
durationSeconds: action.metadata.duration_seconds ?? null,
|
durationSeconds: action.metadata.duration_seconds ?? null,
|
||||||
channelId: action.metadata.channel_id ?? null,
|
channelId: action.metadata.channel_id ?? null,
|
||||||
|
customMessage: action.metadata.custom_message ?? null,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
@@ -4267,6 +4267,7 @@ export interface AutoModerationAction {
|
|||||||
export interface AutoModerationActionMetadata {
|
export interface AutoModerationActionMetadata {
|
||||||
channelId: Snowflake | null;
|
channelId: Snowflake | null;
|
||||||
durationSeconds: number | null;
|
durationSeconds: number | null;
|
||||||
|
customMessage: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutoModerationTriggerMetadata {
|
export interface AutoModerationTriggerMetadata {
|
||||||
|
|||||||
1
typings/rawDataTypes.d.ts
vendored
1
typings/rawDataTypes.d.ts
vendored
@@ -247,6 +247,7 @@ export interface APIAutoModerationAction {
|
|||||||
export interface APIAutoModerationActionMetadata {
|
export interface APIAutoModerationActionMetadata {
|
||||||
channel_id?: Snowflake;
|
channel_id?: Snowflake;
|
||||||
duration_seconds?: number;
|
duration_seconds?: number;
|
||||||
|
custom_message?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface APIAutoModerationRule {
|
export interface APIAutoModerationRule {
|
||||||
|
|||||||
Reference in New Issue
Block a user