private async void Stopwatch_Elapsed(object sender, ElapsedEventArgs e) { await Logger.Info("Restart", "Inactivity restart timer has been reached, restarting..."); detectionService.Disable(); await client.ReconnectAsync(true); }
private async Task Client_Ready(DiscordClient sender, DSharpPlus.EventArgs.ReadyEventArgs e) { // Okay now trust me here; I dont know WHY this needs to be run as its own Task in order for it to work // .......but it does. // Random bullshit, go! _ = Task.Run(async() => { await Logger.Warning("Monitor", "Detected client reconnect; attempting channel check..."); detectionService.Disable(); await client.GetGuildAsync(channel.GuildId.Value, true); await channel.Guild.GetMemberAsync(client.CurrentUser.Id); await Client_VoiceStateUpdated(sender, null); }); }