The PyTMBot supports several command-line arguments to customize its behavior. Below is a detailed description of each argument you can use when starting the bot.
Argument | Type | Default | Choices | Description |
---|---|---|---|---|
--mode |
str |
prod |
dev , prod |
Select the mode of operation for PyTMBot. Use dev for development and prod for production. |
--log-level |
str |
INFO |
DEBUG , INFO , ERROR |
Set the logging level for the bot. More verbose logs can be helpful during development. |
--webhook |
str |
False |
True , False |
Start the bot in webhook mode. Useful for receiving updates via HTTP callbacks. |
--socket_host |
str |
127.0.0.1 |
N/A | Define the host address for the socket to listen on in webhook mode. Default is localhost. |
--plugins |
list |
[] |
N/A | Specify a list of plugins to load when starting the bot. Separate multiple plugins with spaces. |
--salt |
str |
False |
N/A | Generate unique salt for using it in TOTP auth |
Depending on the command-line arguments you choose, certain configuration settings must be filled out in your configuration file. Below are the sections you need to complete:
prod_token
or dev_bot_token
.global_chat_id
for notifications.allowed_user_ids
, allowed_admins_ids
, and auth_salt
.--webhook True
)webhook_config
section.Bot cannot be run in 80 port for security reasons. Use reverse proxy to run the bot (e.g. Nginx, Nginx Proxy Manager or Traefik).
--plugins
)monitor
section of your configuration.
InfluxDB
is required for Monitor Plugin
. InfluxDB Settings: Set the url
, token
, org
, and bucket
values.api_url
and cert
paths for the Outline API.To start the PyTMBot in development mode with debug logging and the monitor plugin enabled, you can run the following command:
python main.py --mode dev --log-level DEBUG --plugins monitor
To run the bot in production mode with webhook support, use:
python main.py --mode prod --webhook True
📜 Notes
Happy Botting! 🤖