Ejemplo n.º 1
0
        private static void ToggleAudioCmd()
        {
            Config.bot.AudioSettings.AudioServicesEnabled = !Config.bot.AudioSettings.AudioServicesEnabled;
            Config.SaveConfig();

            Logger.Log($"The audio service was set to {Config.bot.AudioSettings.AudioServicesEnabled}",
                       LogVerbosity.Music);
            if (Config.bot.AudioSettings.AudioServicesEnabled)
            {
                AudioCheckService.CheckAudioService();
            }
        }
Ejemplo n.º 2
0
        private static async void ForceAudioUpdateCmd()
        {
            Logger.Log("Updating audio files.", LogVerbosity.Music);
            foreach (ServerMusicItem channel in AudioService.currentChannels)
            {
                channel.AudioClient.Dispose();
            }

            await Task.Delay(1000);

            //Delete old files first
            Directory.Delete("External/", true);
            File.Delete("libsodium.dll");
            File.Delete("opus.dll");

            AudioCheckService.UpdateAudioFiles();
            Logger.Log("Audio files were updated.", LogVerbosity.Music);
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            Logger.InitiateLogger();

            //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.Log("Pootis-Bot starting...");

            //This is just suggesting to use 64-bit
            if (!Environment.Is64BitOperatingSystem)
            {
                Logger.Log("This OS is a 32-bit os, 64-Bit is recommended!", LogVerbosity.Warn);
            }

            Logger.Log("Creating the HttpClient object...", LogVerbosity.Debug);
            Global.HttpClient = new HttpClient();

            Logger.Log("Setting up global variable...", LogVerbosity.Debug);
            Global.BotName   = Config.bot.BotName;
            Global.BotPrefix = Config.bot.BotPrefix;
            Global.BotToken  = Config.bot.BotToken;

            //Check the audio services, if they are enabled
            AudioCheckService.CheckAudioService();

            Console.Title = $"{Global.BotName} Console";

            //Setup the bot, put in the name, prefix and token
            Logger.Log("Creating the bot instance...", LogVerbosity.Debug);
            Bot bot = new Bot();

            Logger.Log("Starting the bot...");

            //Start her up!
            bot.StartBot().GetAwaiter().GetResult();
        }