Fix unexpected error message on nonexistent user
This commit is contained in:
parent
d3414f7b04
commit
11ac7418c6
1 changed files with 3 additions and 3 deletions
|
@ -65,10 +65,10 @@ abstract class NoteWarn : CommandConfig {
|
||||||
var targetUser = g.GetUser(targetId);
|
var targetUser = g.GetUser(targetId);
|
||||||
|
|
||||||
// Go to specific action
|
// Go to specific action
|
||||||
try {
|
if (targetUser == null) {
|
||||||
|
await msg.Channel.SendMessageAsync(":x: Unable to find the specified user.");
|
||||||
|
} else {
|
||||||
await ContinueInvoke(g, msg, logMessage, targetUser);
|
await ContinueInvoke(g, msg, logMessage, targetUser);
|
||||||
} catch (Discord.Net.HttpException ex) when (ex.HttpCode == System.Net.HttpStatusCode.Forbidden) {
|
|
||||||
await msg.Channel.SendMessageAsync(":x: " + Messages.ForbiddenGenericError);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue