vamo_telbot.config.telegram

Telegram Bot configuration.

Handles loading and saving the Bot configuration and secrets.

Attributes

Functions

load_api_id()

Load the telegram API ID from the configuration file.

save_api_id(api_id)

Persist the API ID into the configuration file.

load_api_hash()

Load the telegram API HASH from the configuration file.

save_api_hash(api_hash)

Persist the API HASH into the configuration file.

load_bot_token()

Load the telegram Bot Token from the configuration file.

save_bot_token(bot_token)

Persist the Bot Token into the configuration file.

Module Contents

vamo_telbot.config.telegram._API_ID_KEY: Final[str] = 'api_id'
vamo_telbot.config.telegram._API_HASH_KEY: Final[str] = 'api_hash'
vamo_telbot.config.telegram._BOT_TOKEN_KEY: Final[str] = 'bot_token'
vamo_telbot.config.telegram.HASH_OR_TOKEN_NOT_SET: Final[str] = 'NOT_SET'
vamo_telbot.config.telegram.ID_NOT_SET: Final[int] = 1
vamo_telbot.config.telegram.load_api_id()

Load the telegram API ID from the configuration file.

Returns:

The stored API ID if present, otherwise ID_NOT_SET.

Return type:

int

vamo_telbot.config.telegram.save_api_id(api_id)

Persist the API ID into the configuration file.

Parameters:

api_id (int) – API ID to store.

Return type:

None

vamo_telbot.config.telegram.load_api_hash()

Load the telegram API HASH from the configuration file.

Returns:

The stored API HASH if present, otherwise HASH_OR_TOKEN_NOT_SET.

Return type:

str

vamo_telbot.config.telegram.save_api_hash(api_hash)

Persist the API HASH into the configuration file.

Parameters:

api_hash (str) – API HASH to store.

Return type:

None

vamo_telbot.config.telegram.load_bot_token()

Load the telegram Bot Token from the configuration file.

Returns:

The stored Bot Token if present, otherwise HASH_OR_TOKEN_NOT_SET.

Return type:

str

vamo_telbot.config.telegram.save_bot_token(bot_token)

Persist the Bot Token into the configuration file.

Parameters:

bot_token (str) – Bot Token to store.

Return type:

None