A Telegram bot for sharing and receiving location-based airdrops. Users can send a drop message with text, photo, video, or voice content, and the bot can also listen for nearby drops based on the last shared location.
/start— register user and prompt for location sharing/help— show available commands and usage guidance/listen— enable listening for nearby air-drops/stop— stop listening for nearby drops/airdrop— create a new drop message by sending content after the command- Supports one-time location sharing with Telegram and live location requests
- Uses MongoDB, Redis, and RabbitMQ for persistence, queueing, and state management
- The bot starts with
src/bot.ts. - It connects to MongoDB, Redis, and launches a worker for background tasks.
- Commands are registered from
src/commands. - Message listeners process user replies and handle pending airdrop content.
- Geo-based airdrop discovery is driven by user location and active listening state.
/start— initialize the bot and show location sharing options/help— display help and command list/listen— start receiving nearby airdrop notifications/stop— stop receiving nearby notifications/airdrop— begin creating a new airdrop; send content within 60 seconds
src/bot.ts— main entrypoint and startup logicsrc/commands/— command handlerssrc/listeners/— update and message listenerssrc/services/— business logic for user, location, listen, message, and airdrop flowssrc/lib/— helper utilities, Redis connector, replies, and modelssrc/worker/— background worker setup
- Node.js (recommended v18+)
- MongoDB
- Redis
- RabbitMQ
- Telegram bot token
Create a .env file in the project root with:
BOT_TOKEN=your-telegram-bot-token
MONGODB_URI=mongodb://localhost:27017/air_drop_bot
DEFAULT_AIRDROP_RADIUS=2000 # In meters 1000m -> 1km
RABBITMQ_URL=amqp://user:pass@localhost:5672
REDIS_URL=redis://localhost:6379Install dependencies:
pnpm installStart services with Docker Compose:
docker compose up -dRun the bot:
pnpm start- The bot uses Redis to track pending airdrop state for one minute after
/airdrop. - Location sharing is required before
/listencan activate. - The project currently uses polling mode via Telegraf.
This project does not include a license file. Add one if you want to share or publish it.
