3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-14 05:57:18 +00:00

Fixed note command not allowing only attachments

This commit is contained in:
Dark 2021-01-17 05:08:42 +01:00
parent f4b13529c6
commit fd503ea2b8
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8

View file

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