A Telegram bot built in Go that echoes various types of messages back to users with feedback collection functionality.
-
Multi-format Echo: Replies with the same type of content received:
- π Text messages
- π Stickers
- π· Photos
- π€ Voice messages
- π₯ Videos and video notes
- π Documents and audio files
- π Locations
- π Polls
- π€ Contact sharing
-
Command System:
/start- Welcome message/help- Show available commands/about- Bot information/feedback <text>- Submit feedback
-
Feedback Collection:
- Saves feedback to a local file (
feedback.txt) - Forwards feedback to specified admin chat
- File-based storage for simplicity
- Saves feedback to a local file (
TelegramEchoBot/ βββ cmd/ β βββ bot/ β βββ main.go # Application entry point βββ internal/ β βββ bot/ β β βββ bot.go # Bot initialization and main loop β β βββ handlers/ # Message handlers β β βββ commands.go # Command processing β β βββ messages.go # Regular message processing β β βββ feedback.go # Feedback handling β βββ config/ β β βββ config.go # Configuration loading β βββ storage/ β βββ feedback.go # Feedback storage βββ .env.example # Environment variables template βββ go.mod # Go module definition βββ go.sum # Dependency checksums
- Go 1.16+
- Telegram Bot Token (from @BotFather)
- Clone the repository
git clone https://github.com/fa11astro/TelegramEchoBot.git cd TelegramEchoBot - Install dependencies
go mod download
- Configure environment
cp .env.example.env
- Edit .env and add your Telegram Bot Token:
TELEGRAM_BOT_TOKEN=your_bot_token_here
- Run the bot
- Language: Go 1.16+
- Telegram API:
go-telegram-bot-apiv5 - Configuration:
joho/godotenv
cmd/: Application entry pointsinternal/: Private application codeconfig/: Configuration managementhandlers/: Request processing logicstorage/: Data persistence layer
- File-based storage (not suitable for production scale)
- No database integration
- Single admin chat for feedback
- Basic error handling
- Database integration for feedback storage
- Webhook support for production deployment
- Admin panel for feedback management
- Rate limiting and spam protection
- Docker containerization
- Unit and integration tests
Educational project. Free to use and modify.
Happy echoing! π―