telegram_bot_captcha (telegram_bot_captcha v0.3.0)
View SourceTelegram CAPTCHA Bot Application
This application manages Telegram bots that use webhooks to implement CAPTCHA and anti-spam verification when users join chats.
Features:
- Webhook server initialization and management
- Dynamic bot registration and removal
- Event handling via gen_event
- Per-bot HTTP connection pools
- User moderation (mute / ban)
Architecture:
- application behaviour — entry point
- gen_server — state management
- supervisor — child process management
- webhook server — receives Telegram updates
Configuration example (sys.config):
{telegram_bot_captcha, [
{webhook, #{
ip => ~"0.0.0.0",
port => 8443,
secret_token => ~"secret",
transport_opts => #{certfile => "..."}
}},
{bots, [BotConfig]}
]}.
Summary
Types
-type bot_name() :: atom().
-type minute() :: non_neg_integer().
-type state() :: #{webhook_id := webhook_id(), webhook_param := webhook_param(), bots := [bot()]}.
-type user_id() :: integer().
-type webhook_id() :: term().