A simple Telegram TodoList bot written in Go, built with a clean layered architecture (handlers → services → repositories) and the official go-telegram-bot-api library.
The bot lets users manage tasks via Telegram commands and custom keyboards.
- 📋 Create and manage todo tasks
- ⌨️ Custom reply keyboards (commands menu)
- 🧩 Modular project structure (easy to extend)
- 🗄️ Database layer abstraction
- ⚙️ Environment-based configuration
TELEGRAM-TODOLIST/
├── clients/ # Telegram client initialization
│ └── telegram.go
├── config/ # App configuration
│ └── config.go
├── database/ # Database connection & setup
│ └── database.go
├── handlers/ # Telegram update handlers
│ ├── callbacks.go
│ ├── commands.go
│ ├── init.go
│ └── messages.go
├── keyboards/ # Reply & inline keyboards
│ └── cmd_keyboard.go
├── models/ # Data models
│ └── task.go
├── repositories/ # Data access layer
│ └── repository.go
├── services/ # Business logic
│ └── tasks.go
├── utils/ # Helper utilities
├── .env # Environment variables
├── main.go # Application entry point
└── go.mod / go.sum
The bot uses a reply keyboard with predefined commands:
/start– Initialize the bot/money– Example command (extendable)
You can find the keyboard definition in:
keyboards/cmd_keyboard.go
- Go 1.20+
- Telegram Bot Token (from @BotFather)
- (Optional) Database supported by your implementation
git clone https://github.com/your-username/telegram-todolist.git
cd telegram-todolistCreate a .env file in the root directory:
BOT_TOKEN=your_telegram_bot_tokenAdd other variables as needed (DB credentials, etc.).
go mod tidygo run main.goIf everything is correct, the bot will start listening for updates 🎉
- Handlers – Work with Telegram updates (messages, commands, callbacks)
- Services – Contain business logic
- Repositories – Abstract data storage
- Keyboards – Isolated keyboard definitions for reuse
This separation makes the bot easy to test and extend.
Ideas for improvements:
- ✅ Inline keyboards for task actions
- 🗂️ Task categories
- ⏰ Reminders & scheduled notifications
- 👤 Per-user task lists
- 🧪 Unit tests for services
MIT License. Feel free to use and modify.
Pull requests are welcome! Feel free to open an issue for ideas or bugs.
Happy coding 🚀