Skip to content

About

Telegram bot for Barter chat

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Barter Bot

Telegram bot for the barter chat: marks active club members with 👌 and runs captcha confirmation in selected telegram topics.

Setup

uv sync

Required 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

Behaviour

  • Membership — on every user message in the configured chat, the bot calls GET /user/by_telegram_id/{id}.json (base URL from club.api_base in 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_topics in config.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.

About

Telegram bot for Barter chat

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages