Skip to content

Send logs from your application straight to telegram. No hassle

Notifications You must be signed in to change notification settings

coloredlambda/polylogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PolyLogger

Send small messages and logs to yourself on telegram with no hassle

Getting Started

  • Create a Telegram bot with BotFather and take note of the telegram bot token provided

Prerequisites

  • Node.JS
  • NPM

Installing

Install from npm

npm i --save polylogger

or clone from this repo

git clone https://github.com/mullwar/telebot.git
cd polylogger
npm install

Usage

Import polylogger module and create a new connection object:

const Logger = require('polylogger');

const loggerBot = Logger({
    botToken: 'j89efj983u893', // This is the token provided by BotFather
    password: 'aStrongPassword' // This is the password you pass to the bot when subscribing for logs
});

// Sending info
loggerBot.sendInfo('Sending simple info from application');

// Sending error
loggerBot.sendError('Sending simple error from application');

Setting up the bot / Bot commands

  • Go to your bot on telegram
  • Send /echo to test if it's working. It should send back a message
  • Send /auth yourPassword to subscribe to logs. yourPassword is the password string you passed to polylogger when initializing

Built With

Contributions

PRs are welcome

About

Send logs from your application straight to telegram. No hassle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published