Ejemplo n.º 1
0
        public static void Shutdown()
        {
            TelegramIntegration.StopPoll();
            Updater.Stop();

            if (Client != null)
            {
                try
                {
                    "Disconnecting..".Log();

                    foreach (ServerData SD in ServerData.Servers.Values)
                    {
                        $"{SD.Music.Save(SD.Server)} songs saved in {SD.Name}".Log();
                        SD.StopHandlers();
                    }

                    Client.Disconnect().Wait();
                }
                catch { }
                finally
                {
                    Client = null;
                }
            }
        }