mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 02:25:01 +00:00
Update backend/src/plugins/ModActions/functions/parseReason.ts
Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
parent
58b515322e
commit
a1b8dcc30c
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ const MAX_REASON_LENGTH = 512;
|
||||||
export function parseReason(config: TConfigSchema, reason: string): string {
|
export function parseReason(config: TConfigSchema, reason: string): string {
|
||||||
if (!reason) return reason;
|
if (!reason) return reason;
|
||||||
if (config?.reason_aliases) {
|
if (config?.reason_aliases) {
|
||||||
reason = config.reason_aliases![reason.toLowerCase()] ?? reason;
|
reason = config.reason_aliases[reason.toLowerCase()] ?? reason;
|
||||||
}
|
}
|
||||||
if (reason!.length > MAX_REASON_LENGTH) {
|
if (reason!.length > MAX_REASON_LENGTH) {
|
||||||
reason = reason!.substring(0, MAX_REASON_LENGTH - 4) + " […]";
|
reason = reason!.substring(0, MAX_REASON_LENGTH - 4) + " […]";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue