Пример #1
0
        private static void Main()
        {
            Console.CancelKeyPress += ConsoleOnCancelKeyPress;
            Console.SetOut(new PrefixedWriter());
            Console.Title = "TS3ModularBot";
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            try
            {
                _config = JsonConvert.DeserializeObject <Ts3Config>(GetConfig());
            }
            catch (Exception e)
            {
                Console.WriteLine($"Config file is corrupted / has not been found! Exception: {e.StackTrace}");
                Console.ReadLine();
                Environment.Exit(0);
            }

            _teamSpeak3Bot = new TeamSpeak3Bot(_config);
            _teamSpeak3Bot.Run();

            while (_teamSpeak3Bot.Connected)
            {
                Console.ReadKey(true);
            }

            _teamSpeak3Bot = null;
            Console.ReadLine();
        }
Пример #2
0
 public TeamSpeak3Bot(Ts3Config config)
 {
     Ts3Config = config;
 }