mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-21 08:45:03 +00:00
Don't send null/undefined as audit log reasons
This commit is contained in:
parent
c2ca3d605f
commit
e6d7bb15eb
4 changed files with 8 additions and 4 deletions
|
@ -40,7 +40,11 @@ export async function banUserId(
|
|||
ignoreEvent(pluginData, IgnoredEventType.Ban, userId);
|
||||
try {
|
||||
const deleteMessageDays = Math.min(30, Math.max(0, banOptions.deleteMessageDays ?? 1));
|
||||
await pluginData.guild.banMember(userId, deleteMessageDays, encodeURIComponent(reason));
|
||||
await pluginData.guild.banMember(
|
||||
userId,
|
||||
deleteMessageDays,
|
||||
reason != null ? encodeURIComponent(reason) : undefined,
|
||||
);
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "failed",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue