Telegram Handler

Telegram bot handler.

class folderbot.telegram_handler.TelegramBot[source]

Bases: object

Main Telegram bot class.

__init__(config)[source]
Parameters:

config (Config)

async start_command(update, context)[source]

Handle /start command.

Return type:

None

Parameters:
async clear_command(update, context)[source]

Handle /clear command.

Return type:

None

Parameters:
async new_command(update, context)[source]

Handle /new command.

Return type:

None

Parameters:
async status_command(update, context)[source]

Handle /status command.

Return type:

None

Parameters:
async files_command(update, context)[source]

Handle /files command.

Return type:

None

Parameters:
async handle_message(update, context)[source]

Handle regular messages with immediate processing and restart on new message.

Return type:

None

Parameters:
async handle_document(update, context)[source]

Handle document uploads.

Return type:

None

Parameters:
async handle_photo(update, context)[source]

Handle photo uploads: save to uploads and process with LLM vision.

Return type:

None

Parameters:
async handle_voice(update, context)[source]

Handle voice messages and audio files by transcribing and processing as text.

Return type:

None

Parameters:
async wait_for_processing(user_id)[source]

Wait for any pending processing to complete. For testing.

Return type:

None

Parameters:

user_id (int)

ASK_USER_TIMEOUT_SECONDS = 120
async tasks_command(update, context)[source]

Handle /tasks command.

Return type:

None

Parameters:
run()[source]

Run the bot.

Return type:

None