QuotoBot is a Telegram bot for collecting and sharing quotes with your community. It allows users to add quotes, vote on them, search for quotes, and more. The bot includes user authentication through ViaRézo OAuth to ensure only authorized users can interact with it.
- User authentication via ViaRézo OAuth
- Add new quotes with author attribution
- Vote system for quotes
- Search quotes by content or author
- View random quotes
- Get top voted quotes
- Secure registration process
- Docker-ready for easy deployment
QuotoBot consists of two main components:
- Telegram Bot: Handles all user interactions through Telegram commands
- Web Server: Manages user registration and authentication via OAuth
quotobot/
├── cmd/ # Command-line entry points
│ ├── bot/ # Bot command
│ ├── server/ # Server command
├── internal/ # Application code
│ ├── bot/ # Bot implementation
│ ├── server/ # Web server implementation
├── pkg/ # Shared packages
│ ├── config/ # Configuration handling
│ ├── database/ # Database models and connection
│ ├── logger/ # Logging utilities
- Go 1.25+
- SQLite
- A registered Telegram bot token (from @BotFather)
- OAuth credentials from ViaRézo
- Create a
config.yaml
file based on the provided template:
bot:
token: your_telegram_bot_token
chat_id: your_telegram_chat_id
base_url: your_server_domain
hmac_secret: your_hmac_secret_key
server:
env: dev|prod
session_secret: your_session_secret
hmac_secret: your_hmac_secret_key
provider_url: https://moncompte.viarezo.fr
client_id: your_oauth_client_id
client_secret: your_oauth_client_secret
redirect_url: https://your_server_domain/oauth/callback
- Build and run the bot:
go run main.go bot
- Build and run the server:
go run main.go server
QuotoBot includes a Docker setup for easy deployment:
# Build the image
docker-compose build
# Run the services
docker-compose up -d
This will start both the bot and server components, along with a Traefik reverse proxy for HTTPS support.
Command | Description | Parameters |
---|---|---|
/register |
Register with the bot | None |
/add |
Add a new quote | Format: /add | quote content | | author | |
/random |
Get random quotes | Optional: number of quotes to retrieve |
/last |
Get latest quotes | Optional: number of quotes to retrieve |
/get |
Get a quote by ID | Quote ID |
/search |
Search quotes | Search term, optional: number of results |
/vote |
Vote for a quote | Quote ID |
/unvote |
Remove your vote | Quote ID |
/score |
View vote count | Quote ID |
/top |
View top quotes | Optional: number of quotes to retrieve |
- Start a private conversation with the bot
- Use the
/register
command - Click the provided link
- Authenticate with your ViaRézo account
- Complete the registration process
- Built with go-telegram-bot
- Uses GORM for database access
- Authentication powered by go-oidc
Built with ❤️ for ViaRézo