Exemple #1
0
 public void Start()
 {
     _bot = new TelegramBotClient(_PKEY);
     Console.WriteLine("Starting bot...");
     _bot.OnMessage       += _botMessageHandler;
     _bot.OnCallbackQuery += _botCallbackHandler;
     _bot.StartReceiving();
     _renderer = new Renderer(_bot);
 }
        public void Handle(IRequest request, IResponseRenderer renderer)
        {
            foreach (IRequestHandler handler in _handlers)
            {
                RequestHandlingResult result = handler.HandleRequest(request);
                if (result.IsHandled)
                {
                    renderer.Render(result.Response);

                    return;
                }
            }
        }
        public void Handle(IRequest request, IResponseRenderer renderer)
        {
            foreach (IRequestHandler handler in _handlers)
            {
                RequestHandlingResult result = handler.HandleRequest(request);
                if (result.IsHandled)
                {
                    renderer.Render(result.Response);

                    return;
                }
            }
        }
Exemple #4
0
 public void Render(IResponseRenderer renderer, int chatId)
 {
     renderer.RenderPlainText(this, chatId);
 }
Exemple #5
0
 public void Render(IResponseRenderer renderer, int chatId)
 {
     renderer.RenderMenu(this, chatId);
 }