bot.setup Module

This module contains functions for setting up to bot at start up.

bot.setup.BOT_COMMANDS: List[telegram.botcommand.BotCommand] = [<telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>, <telegram.botcommand.BotCommand object>]

A list of commands of the bot.

Type

List[telegram.BotCommand]

bot.setup.setup(dispatcher, admin, oc_url, oc_username, oc_password, oc_path, ad_url, ad_url_active, ad_username, ad_password, yourls_url, yourls_signature)
  • Adds handlers. Convenience method to avoid doing that all in the main script.

  • Sets the bot commands and makes sure dispatcher.bot_data is set up correctly.

  • Registers a telegram.ext.TypeHandler that makes sure that conversations are not interrupted

  • Sets up statistics

Parameters
  • dispatcher (Dispatcher) – The telegram.ext.Dispatcher.

  • admin (Union[int, str]) – The admins chat id.

  • oc_url (str) – URL of the OwnCloud Instance.

  • oc_username (str) – Username for the OwnCloud Instance.

  • oc_password (str) – Password of the OwnCloud Instance.

  • oc_path (str) – Remote path on the OwnCloud Instance.

  • ad_url (str) – URL of the AkaDressen file.

  • ad_url_active (str) – URL of the AkaDressen file containing only the active members.

  • ad_username (str) – Username for the AkaDressen.

  • ad_password (str) – Password for the AkaDressen.

  • yourls_url (str) – URL of the YOURLS instance.

  • yourls_signature (str) – Signature for the YOURLS instance.

Return type

None