onenotif
v0.1.0
Published
Simple terminal notification viewer for Telegram and other sources
Maintainers
Readme
OneNotif
Simple terminal notification viewer for Telegram and other sources.
Installation
npm install -g onenotifRequires Node.js 18 or higher.
Setup
Create a Telegram bot:
- Open Telegram and search for @BotFather
- Send
/newbotand follow the instructions - Copy the bot token
Get your Telegram ID:
- Search for @userinfobot in Telegram
- It will show your user ID
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:
onenotifSend 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 startAdding 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
