return if there is an error assigning roles

This commit is contained in:
Kwoth 2016-07-28 16:19:44 +02:00
parent 204674f047
commit d765b16649

View File

@ -149,9 +149,10 @@ namespace NadekoBot.Modules.Administration.Commands
catch (HttpException ex) when (ex.StatusCode == System.Net.HttpStatusCode.InternalServerError) catch (HttpException ex) when (ex.StatusCode == System.Net.HttpStatusCode.InternalServerError)
{ {
} }
catch (Exception) catch (Exception ex)
{ {
await e.Channel.SendMessage($":anger:`I am unable to add that role to you. I can't add roles to owners or other roles higher than my role in the role hierarchy.`").ConfigureAwait(false); await e.Channel.SendMessage($":anger:`I am unable to add that role to you. I can't add roles to owners or other roles higher than my role in the role hierarchy.`").ConfigureAwait(false);
return;
} }
var msg = await e.Channel.SendMessage($":ok:You now have {role.Name} role.").ConfigureAwait(false); var msg = await e.Channel.SendMessage($":ok:You now have {role.Name} role.").ConfigureAwait(false);
await Task.Delay(3000).ConfigureAwait(false); await Task.Delay(3000).ConfigureAwait(false);