.vcrole will try twice to remove role from leaving users

This commit is contained in:
Kwoth 2017-03-18 13:23:39 +01:00
parent 2331b2ea20
commit 0d1e870325

View File

@ -70,10 +70,19 @@ namespace NadekoBot.Modules.Administration
if (oldVc != null && guildVcRoles.TryGetValue(oldVc.Id, out role))
{
if (gusr.RoleIds.Contains(role.Id))
{
try
{
await gusr.RemoveRolesAsync(role).ConfigureAwait(false);
await Task.Delay(500).ConfigureAwait(false);
}
catch
{
await Task.Delay(200).ConfigureAwait(false);
await gusr.RemoveRolesAsync(role).ConfigureAwait(false);
await Task.Delay(500).ConfigureAwait(false);
}
}
}
//add new
if (newVc != null && guildVcRoles.TryGetValue(newVc.Id, out role))