telenoty
📢 Simple and Easy to emit notification via Telegram
Installation
npm install -g telenoty
Usage
- Required - Telegram Bot
- Create your Telegram bot
- Get access token
- Get chat id
- Regist and enjoy!
# Regist bot information (save on ~/.telenoty)
# --regist, -r
telenoty --regist {BOT_TOKEN} {CHAT_ID}
# Send message
# --message, -m
telenoty --message {MESSAGE}
- More usage
- with Python
Create bot
-
Create Telegram bot
-
Get access token
- Send bot name and ID
- Copy access token (for registration)
- Go to chat room
-
Get chat id
- Send any message
- Copy chat id
-
Regist and enjoy!
with Python
import subprocess
def send_message(message):
return subprocess.call(['telenoty', '--message', message], \
stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
result = send_message('test')
if result == 0:
print('success')
else:
print('fail')
Devlopment
# Install dependencies
npm i
# Build for production
npm run build
# Test
node dist/telenoty.js