mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
resolveUser: return null if the passed value is not a valid id
This commit is contained in:
parent
5215dd0738
commit
a641312853
6 changed files with 21 additions and 4 deletions
|
@ -41,6 +41,11 @@ export async function muteUser(
|
|||
}
|
||||
|
||||
const user = await resolveUser(pluginData.client, userId);
|
||||
if (!user) {
|
||||
lock.unlock();
|
||||
throw new RecoverablePluginError(ERRORS.INVALID_USER);
|
||||
}
|
||||
|
||||
const member = await resolveMember(pluginData.client, pluginData.guild, user.id); // Grab the fresh member so we don't have stale role info
|
||||
const config = pluginData.config.getMatchingConfig({ member, userId });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue