private static void ToggleAudioCmd() { Config.bot.AudioSettings.AudioServicesEnabled = !Config.bot.AudioSettings.AudioServicesEnabled; Config.SaveConfig(); Logger.Info("The audio service was set to {@AudioServicesEnabled}", Config.bot.AudioSettings.AudioServicesEnabled); if (Config.bot.AudioSettings.AudioServicesEnabled) { MusicLibsChecker.CheckMusicService(); } }
private static async void ForceAudioUpdateCmd() { Logger.Info("Updating audio files."); foreach (ServerMusicItem channel in MusicService.currentChannels) { channel.AudioClient.Dispose(); } await Task.Delay(1000); //Delete old files first Directory.Delete(Config.bot.AudioSettings.ExternalDirectory, true); MusicLibsChecker.GetLibsPreparer().DeleteFiles(); MusicLibsChecker.CheckMusicService(true); Logger.Info("Audio files were updated."); }
public static void Main(string[] args) { Logger.Init(); ArgumentsProcessor.ParseArguments(args); //Ascii art of Pootis-Bot because why not ¯\_(ツ)_/¯ Console.WriteLine(@"__________ __ .__ __________ __ "); Console.WriteLine(@"\______ \____ _____/ |_|__| ______ \______ \ _____/ |_ "); Console.WriteLine(@" | ___/ _ \ / _ \ __\ |/ ___/ ______ | | _// _ \ __\"); Console.WriteLine(@" | | ( <_> | <_> ) | | |\___ \ /_____/ | | ( <_> ) | "); Console.WriteLine(@" |____| \____/ \____/|__| |__/____ > |______ /\____/|__| "); Console.WriteLine(@" \/ \/ "); Console.WriteLine($" Version: {VersionUtils.GetAppVersion()}"); Console.WriteLine(); Logger.Info("Pootis-Bot starting..."); Logger.Debug("Creating the HttpClient object..."); Global.HttpClient = new HttpClient(); Logger.Debug("Setting up global variables..."); Global.BotName = Config.bot.BotName; Global.BotPrefix = Config.bot.BotPrefix; Global.BotToken = Config.bot.BotToken; //Check the audio services, if they are enabled MusicLibsChecker.CheckMusicService(); Console.Title = $"{Global.BotName} Console"; //Setup the bot, put in the name, prefix and token Logger.Debug("Creating the bot instance..."); Bot bot = new Bot(); Logger.Debug("Starting the bot..."); //Start her up! bot.StartBot().GetAwaiter().GetResult(); }