-
Notifications
You must be signed in to change notification settings - Fork 23
[Daemon] telegram chat bot
Telegram Messenger is a popular mobile messaging app that excels in communication security.
The chat bot enables you to invoke app commands via chat messages.
Acquire an AuthorizationToken
from Telegram Messenger by creating your own chat bot. Download and install Telegram
Messenger, then follow the guide How do I create a bot? to talk to "BotFather" and
register your chat bot.
After chat bot is successfully created, Telegram Messenger will tell you the AuthorizationToken
, which you have to
place into the configuration.
- Construct the following JSON object and place it under JSON key
TelegramBot
in configuration file:
Property | Type | Meaning | Default value |
---|---|---|---|
AuthorizationToken | string | Registered bot authorisation token. | (This is a mandatory property without a default value) |
PerUserLimit | integer | Maximum number of app commands a chat may send in a second. | 2 - good enough for personal use |
- Follow command processor to construct configuration for
JSON key
TelegramFilters
.
Here is an example setup:
{ ... "TelegramBot": { "AuthorizationToken": "425712345:ABCDEFGHIJKLMNOPERSTUVWXYZ" }, "TelegramFilters": { "PINAndShortcuts": { "Passwords": ["VerySecretPassword"], "Shortcuts": { "watsup": ".eruntime", "EmergencyStop": ".estop", "EmergencyLock": ".elock" } }, "TranslateSequences": { "Sequences": [ ["#/", "|"] ] }, "LintText": { "CompressSpaces": false, "CompressToSingleLine": false, "KeepVisible7BitCharOnly": false, "MaxLength": 4096, "TrimSpaces": false }, "NotifyViaEmail": { "Recipients": ["me@example.com"] } }, ... }
Tell laitos to run chat bot daemon in the command line:
sudo ./laitos -config <CONFIG FILE> -daemons ...,telegram,...
On Telegram Messenger application, find your newly created chat bot via the in-app Search function, then send app command in a chat message. Wait a short moment, and the command response will be sent back to you via the same chat.
Remember to put password in front of the app command.
- The chat bot server will not process messages that arrived before the server started, which means, you cannot leave a message to the chat bot while server is offline.
- If you run multiple instances of laitos, feel free to use identical AuthorizationToken in all of their configuration. Your app command will be processed by all laitos instances simultaneously, and each instance will reply with their own command response.
Table of Contents
- Home
- Get started
- Component list
- Tips for running on public cloud
- Tips for using apps over satellite
- laitos terminal
Daemon Components
- DNS server
- Mail server
- Web server
- Web proxy server
- Telnet server
- Telegram chat-bot
- Simple IP services server
- SNMP server
- System maintenance
- Phone home telemetry
Web Service Components
- Twilio telephone/SMS hook
- Microsoft chat bot hook
- The Things Network LORA tracker integration
- Recurring commands
- App command form
- Simple app command execution API
- GitLab browser
- Temporary file storage
- Simple web proxy
- Desktop on a page (virtual machine)
- Read telemetry records
- Program health report
- System process explorer
- Prometheus metrics exporter
- HTTP request inspector
- HTTP request logger
Apps