Exemplo n.º 1
0
        public static void Main( )
        {
            Console.Title = "Crypto Ticker Telegram Bot";
            var ctb = new Bot( );

            ctb.Start( );
            var teleBot = new TeleBot(Settings.Instance.BotToken, ctb);

            teleBot.Start( );
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Bot <Message> bot = null;

            var lazy = new Lazy <TextHandler>(() => new TextHandler(bot.me));

            bot = new Bot <Message>(new MessageHandler(lazy, new PhotoHandler(), new LocationHandler()), new TelegramApi("182754992:AAH-OI66_6Xs4Zqo3KqI74TlGb6CLiXPqXI"));
            var commandList = new ICommand[]
            {
                new Help(lazy),
                new Start(),
                new Timetable(),
                new Time(),
                new Next()
            };

            lazy.Value.AddCommands(commandList);

            bot.Start();
            Console.WriteLine("Doge приветствует вас");
            bot.MessageReceived += (update) => Console.WriteLine($"WoW new message : {DateTime.Now.ToString("T")} Type: {update.Type} Текст{update.Data}");
            Console.ReadLine();
        }
Exemplo n.º 3
0
 public static void Main(string[] args)
 {
     Bot.Start();
     CreateHostBuilder(args).Build().Run();
 }