.vcrole will try twice to remove role from leaving users
This commit is contained in:
parent
2331b2ea20
commit
0d1e870325
@ -70,10 +70,19 @@ namespace NadekoBot.Modules.Administration
|
|||||||
if (oldVc != null && guildVcRoles.TryGetValue(oldVc.Id, out role))
|
if (oldVc != null && guildVcRoles.TryGetValue(oldVc.Id, out role))
|
||||||
{
|
{
|
||||||
if (gusr.RoleIds.Contains(role.Id))
|
if (gusr.RoleIds.Contains(role.Id))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await gusr.RemoveRolesAsync(role).ConfigureAwait(false);
|
await gusr.RemoveRolesAsync(role).ConfigureAwait(false);
|
||||||
await Task.Delay(500).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
|
//add new
|
||||||
if (newVc != null && guildVcRoles.TryGetValue(newVc.Id, out role))
|
if (newVc != null && guildVcRoles.TryGetValue(newVc.Id, out role))
|
||||||
|
Loading…
Reference in New Issue
Block a user