Telegram bot for the barter chat: marks active club members with 👌 and runs captcha confirmation in selected telegram topics.
uv syncRequired environment variables:
export BOT_TOKEN="123456:ABCDEF..."
export TELEGRAM_CHAT_ID="-1001234567890"
export CLUB_SERVICE_TOKEN="st_..."Optional (set DEBUG=False to use webhooks):
export WEBHOOK_URL="https://your-domain.com"
export WEBHOOK_LISTEN="0.0.0.0"
export WEBHOOK_PORT="8080"
export WEBHOOK_PATH="/webhook"
export WEBHOOK_SECRET_TOKEN="some-random-secret"Run:
uv run python main.py- Membership — on every user message in the configured chat, the bot calls
GET /user/by_telegram_id/{id}.json(base URL fromclub.api_basein config). Active members get a reaction (club.member_reaction); everyone else (unknown user, expired membership) has the message deleted. - Captcha — for topics listed under
captcha_topicsinconfig.yml, the bot replies with your text and approve/reject buttons. Approve within the timeout keeps the message and removes the captcha; reject or timeout deletes both messages.
The bot must be able to delete messages and set reactions in the chat.