Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram TodoList Bot (Go)

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.


✨ Features

  • 📋 Create and manage todo tasks
  • ⌨️ Custom reply keyboards (commands menu)
  • 🧩 Modular project structure (easy to extend)
  • 🗄️ Database layer abstraction
  • ⚙️ Environment-based configuration

🧱 Project Structure

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

⌨️ Commands & Keyboard

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

🚀 Getting Started

1. Prerequisites

  • Go 1.20+
  • Telegram Bot Token (from @BotFather)
  • (Optional) Database supported by your implementation

2. Clone the Repository

git clone https://github.com/your-username/telegram-todolist.git
cd telegram-todolist

3. Environment Variables

Create a .env file in the root directory:

BOT_TOKEN=your_telegram_bot_token

Add other variables as needed (DB credentials, etc.).


4. Install Dependencies

go mod tidy

5. Run the Bot

go run main.go

If everything is correct, the bot will start listening for updates 🎉


🧠 Architecture Notes

  • 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.


🛠️ Extending the Bot

Ideas for improvements:

  • ✅ Inline keyboards for task actions
  • 🗂️ Task categories
  • ⏰ Reminders & scheduled notifications
  • 👤 Per-user task lists
  • 🧪 Unit tests for services

📦 Dependencies


📄 License

MIT License. Feel free to use and modify.


🤝 Contributing

Pull requests are welcome! Feel free to open an issue for ideas or bugs.


Happy coding 🚀

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages