3
0
Fork 0
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:
metal 2021-09-23 12:02:22 +01:00 committed by almeidx
parent 58b515322e
commit a1b8dcc30c
No known key found for this signature in database
GPG key ID: F403F80B79353CB4

View file

@ -5,7 +5,7 @@ const MAX_REASON_LENGTH = 512;
export function parseReason(config: TConfigSchema, reason: string): string {
if (!reason) return reason;
if (config?.reason_aliases) {
reason = config.reason_aliases![reason.toLowerCase()] ?? reason;
reason = config.reason_aliases[reason.toLowerCase()] ?? reason;
}
if (reason!.length > MAX_REASON_LENGTH) {
reason = reason!.substring(0, MAX_REASON_LENGTH - 4) + " […]";