diff --git a/NadekoBot/Classes/NadekoStats.cs b/NadekoBot/Classes/NadekoStats.cs index 7483cde0..7a724d41 100644 --- a/NadekoBot/Classes/NadekoStats.cs +++ b/NadekoBot/Classes/NadekoStats.cs @@ -50,25 +50,25 @@ namespace NadekoBot TextChannelsCount = channelsArray.Count(c => c.Type == ChannelType.Text); VoiceChannelsCount = channelsArray.Count() - TextChannelsCount; - NadekoBot.Client.JoinedServer += (s, e) => + NadekoBot.Client.JoinedServer += async (s, e) => { try { ServerCount++; TextChannelsCount += e.Server.TextChannels.Count(); VoiceChannelsCount += e.Server.VoiceChannels.Count(); - SendUpdateToCarbon(); + await SendUpdateToCarbon().ConfigureAwait(false); } catch { } }; - NadekoBot.Client.LeftServer += (s, e) => + NadekoBot.Client.LeftServer += async (s, e) => { try { ServerCount--; TextChannelsCount -= e.Server.TextChannels.Count(); VoiceChannelsCount -= e.Server.VoiceChannels.Count(); - SendUpdateToCarbon(); + await SendUpdateToCarbon().ConfigureAwait(false); } catch { } }; diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index 89c36dee..f209c7de 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -182,7 +182,7 @@ namespace NadekoBot.Modules.Administration await role.Edit(color: new Color(red, green, blue)); await e.Channel.SendMessage($"Role {role.Name}'s color has been changed."); } - catch (Exception ex) + catch (Exception) { await e.Channel.SendMessage("Error occured, most likely invalid parameters or insufficient permissions."); } diff --git a/NadekoBot/Modules/ClashOfClans/ClashOfClans.cs b/NadekoBot/Modules/ClashOfClans/ClashOfClans.cs index 28b24a76..5d597f60 100644 --- a/NadekoBot/Modules/ClashOfClans/ClashOfClans.cs +++ b/NadekoBot/Modules/ClashOfClans/ClashOfClans.cs @@ -37,7 +37,6 @@ namespace NadekoBot.Classes.ClashOfClans { private static TimeSpan callExpire => new TimeSpan(2, 0, 0); - private CommandEventArgs e; public string EnemyClan { get; } public int Size { get; } @@ -89,7 +88,9 @@ namespace NadekoBot.Classes.ClashOfClans { b.ResetTime(); } +#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed Task.Run(async () => await ClearArray()).ConfigureAwait(false); +#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed await Task.Delay(new TimeSpan(24, 0, 0), endTokenSource.Token); } catch { }