webhook_telegram_bot.telegram.handlers

This file contains Telegram handlers.

Module Contents

Functions

telegram_request_handler(request: aiohttp.web_request.Request) → aiohttp.web.Response

Handle Telegram requests.

get_response_from_plugins(app: aiohttp.web.Application, chat_id: int, command: str) → Optional[aiohttp.web.Response]

Return a response from the plugin if the command refers to one of them.

Attributes

logger

webhook_telegram_bot.telegram.handlers.logger
async webhook_telegram_bot.telegram.handlers.telegram_request_handler(request: aiohttp.web_request.Request) aiohttp.web.Response

Handle Telegram requests.

Parameters

request – request from Telegram API

Returns

bot response

async webhook_telegram_bot.telegram.handlers.get_response_from_plugins(app: aiohttp.web.Application, chat_id: int, command: str) Optional[aiohttp.web.Response]

Return a response from the plugin if the command refers to one of them.

Parameters
  • app – application instance

  • chat_id – chat identification number

  • command – incoming text from Telegram chat

Returns

bot response or None