Skip to content

Ib-R/telegram-notes-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Notes Bot

A Telegram bot for creating professional notes with AI enhancement, stored in SQLite.

Features

  • AI Enhancement: Notes are automatically summarized and tagged using OpenAI-compatible APIs
  • Authorized Access: Only specified chat IDs can use the bot
  • SQLite Storage: Notes are stored locally in a SQLite database
  • Search & Organize: Search notes by content, title, or tags

Prerequisites

  • Node.js 18+
  • Telegram Bot Token (get from @BotFather)
  • OpenAI-compatible API endpoint (LM Studio, LiteLLM, etc.)

Setup

  1. Install dependencies:

    npm install
  2. Configure the bot: Edit config/default.json:

    {
      "telegram": {
        "botToken": "YOUR_BOT_TOKEN"
      },
      "ai": {
        "endpoint": "http://localhost:1234/v1",
        "model": "gpt-3.5-turbo",
        "apiKey": "your-api-key"
      },
      "auth": {
        "allowedChatIds": ["123456789"]
      },
      "database": {
        "path": "./database/notes.db"
      }
    }
  3. Start the bot:

    npm start

Commands

Command Description
/start Welcome message
/help Show available commands
/note <text> Create a new note with AI enhancement
/list List all your notes
/search <query> Search notes by title/content/tags
/delete <id> Delete a note by ID
/tags Show all tags you've used

Example Usage

/note Meeting with team today. Discussed Q4 goals, assigned tasks, and set follow-up for next week.

The bot will respond with:

  • Auto-generated title
  • AI summary
  • Relevant tags

Testing

npm test

File Structure

telegram-notes-bot/
├── src/
│   ├── index.js           # Entry point
│   ├── config.js          # Configuration loader
│   ├── bot/
│   │   ├── commands.js   # Command handlers
│   │   └── middleware.js # Auth middleware
│   ├── services/
│   │   ├── ai.js         # AI client
│   │   ├── notes.js      # Note operations
│   │   └── database.js  # SQLite operations
│   └── utils/
│       └── logger.js
├── tests/                 # Test suite
├── config/
│   └── default.json      # Configuration
├── database/
│   └── schema.sql        # Database schema
└── package.json

License

MIT

About

A Telegram bot providing intelligent note-taking capabilities. Uses modern NLP models (via AI integration) to automatically summarize, tag, and structure user inputs in real-time within Telegram chats. Focuses on turning raw thoughts into organized knowledge bases.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors