.iam error message

This commit is contained in:
Master Kwoth 2016-06-17 13:34:24 +02:00
parent 91b9b9051c
commit b8e90fd6c9

View File

@ -121,7 +121,14 @@ namespace NadekoBot.Modules.Administration.Commands
await e.Channel.SendMessage($":anger:You already have {role.Name} role.").ConfigureAwait(false); await e.Channel.SendMessage($":anger:You already have {role.Name} role.").ConfigureAwait(false);
return; return;
} }
await e.User.AddRoles(role).ConfigureAwait(false); try
{
await e.User.AddRoles(role).ConfigureAwait(false);
}
catch
{
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.`");
}
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); await Task.Delay(3000);
await msg.Delete(); await msg.Delete();