try to sanitize username for warning list mention

This commit is contained in:
13xforever 2024-06-26 23:49:09 +05:00
parent d65f533d32
commit ed78dc24bd
No known key found for this signature in database
GPG Key ID: 2B2A36B482FE70C5

View File

@ -326,7 +326,8 @@ internal sealed partial class Warnings: BaseCommandModuleCustom
table.Add(warning.Id.ToString(), "+", issuerName, timestamp, warning.Reason, warning.FullReason);
}
}
var result = new StringBuilder("Warning list for ").Append(userName);
var result = new StringBuilder("Warning list for ").Append(Formatter.Sanitize(userName));
if (!isPrivate && !isWhitelisted && count > maxWarningsInPublicChannel)
result.Append($" (last {showCount} of {count}, full list in DMs)");
result.AppendLine(":").Append(table);