telegramlib.commands

Telegram Bot Command Module

This module provides functionality for defining and handling default commands within a Telegram bot. It includes decorators to restrict access to certain commands based on user roles and functions to perform specific actions such as executing terminal commands, managing user follow lists, sending messages, and banning users.

Usage

To make these commands usables, it is necessary to add them to the command list during bot start in start_bot function.

Functions

admin_command(func)

Decorator to restrict command execution to the bot's admin.

ban()

Bans specified users from the bot.

closecreator()

Ends the conversation with the bot's creator.

controllers_command(func)

Decorator to restrict command execution to users listed as controllers.

creator()

Initiates a direct conversation with the bot's creator.

follow()

Adds users to the admin's list of followed users.

sban()

Unbans all or specified users from the bot.

terminal()

Executes terminal commands as the admin.

unfollow()

Removes users from the admin's list of followed users.

write()

Sends a message to a specified user from the admin.