3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fixed note command not allowing only attachments (#144)

This commit is contained in:
Nils 2021-01-17 20:30:59 +01:00 committed by GitHub
parent b74c7fae43
commit d4d89327fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ export const NoteCmd = modActionsCmd({
signature: {
user: ct.string(),
note: ct.string({ catchAll: true }),
note: ct.string({ required: false, catchAll: true }),
},
async run({ pluginData, message: msg, args }) {
@ -25,6 +25,11 @@ export const NoteCmd = modActionsCmd({
return;
}
if (!args.note && msg.attachments.length === 0) {
sendErrorMessage(pluginData, msg.channel, "Text or attachment required");
return;
}
const userName = `${user.username}#${user.discriminator}`;
const reason = formatReasonWithAttachments(args.note, msg.attachments);