3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 16:25:03 +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 bd4182bb53
commit 127ef260f1

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);