Skip to content

Repository files navigation

OneNotif

Simple terminal notification viewer for Telegram and other sources.

Installation

npm install -g onenotif

Requires Node.js 18 or higher.

Setup

  1. Create a Telegram bot:

    • Open Telegram and search for @BotFather
    • Send /newbot and follow the instructions
    • Copy the bot token
  2. Get your Telegram ID:

    • Search for @userinfobot in Telegram
    • It will show your user ID
  3. Configure:

Create a config file at ~/.onenotif/config.json:

{
  "sources": {
    "telegram": {
      "enabled": true,
      "botToken": "YOUR_BOT_TOKEN",
      "allowedUsers": ["your_telegram_id"]
    }
  }
}

Or set environment variable:

export ONENOTIF_TELEGRAM_TOKEN="your_bot_token"

Usage

Start the app:

onenotif

Send messages to your bot on Telegram - they'll appear in your terminal!

────────────────────────────────────────────────────────────
 Telegram  · 14:32:15
  John
  Hello from Telegram!
  from @username
────────────────────────────────────────────────────────────

Development

git clone https://github.com/yourusername/onenotif.git
cd onenotif
npm install
npm start

Adding More Sources

Create a new source class in sources/ that extends BaseSource:

import { BaseSource } from './BaseSource.js';

export class MySource extends BaseSource {
  async start() {
    // Your implementation
    // Call this.emit({ title, content, timestamp }) when notification arrives
  }
}

Then add it to cli.js.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages