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

Fix crash from invalid user id in !addcase

This commit is contained in:
Dragory 2020-12-17 04:10:36 +02:00
parent 785813f495
commit d35564eac8
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -29,7 +29,9 @@ export const AddCaseCmd = modActionsCmd({
async run({ pluginData, message: msg, args }) {
const user = await resolveUser(pluginData.client, args.user);
if (!user) return sendErrorMessage(pluginData, msg.channel, `User not found`);
if (!user.id) {
return sendErrorMessage(pluginData, msg.channel, `User not found`);
}
// If the user exists as a guild member, make sure we can act on them first
const member = await resolveMember(pluginData.client, pluginData.guild, user.id);