mini_apps.auto_bot

Automatic command registration system

This functionality makes it easier to define a modular bot, where multiple commands can be loaded from python functions in separate Python modules

class mini_apps.auto_bot.AutoBot(*args)

Bases: App

Bot that automatically loads commands from a directory

async on_telegram_callback(event: CallbackQuery)

Called on button presses on the telegram bot

async on_telegram_command(trigger: str, args: str, event: NewMessage)

Called on a telegram /command

Returns:

True if the command has been handled

async on_telegram_connected()

Called when the connection to the telegram bot is established

async on_telegram_inline(event: CallbackQuery)

Called on telegram bot inline queries

async on_telegram_message(event: NewMessage)

Called on messages sent to the telegram bot

class mini_apps.auto_bot.AutoBotData

Bases: object

Collection of bot event handlers

has_data()

Returns True if there is at least one registered handler

class mini_apps.auto_bot.AutoBotRegistry

Bases: object

Keeps track of all the “auto” bot handlers

bot_button_callback(bot_username)

Registers a bot button callback handler

bot_command(bot_username, trigger=None, description=None, hidden=False)

Registers a bot command handler

bot_inline(bot_username)

Registers a bot inline handler

bot_media(bot_username)

Registers a callback handler for messages containing media

mini_apps.auto_bot.bot_button_callback(bot_username)

Registers a bot button callback handler

mini_apps.auto_bot.bot_command(bot_username, trigger=None, description=None, hidden=False)

Registers a bot command handler

mini_apps.auto_bot.bot_inline(bot_username)

Registers a bot inline handler

mini_apps.auto_bot.bot_media(bot_username)

Registers a callback handler for messages containing media