0.0.4 • Published 6 years ago

teloggo v0.0.4

Weekly downloads
2
License
GPL v2
Repository
github
Last release
6 years ago

teloggo

Use telegram like console.log

It will handle long message and object as input.

No external dependencies.

Usage

npm install --save teloggo
const teloggo = require('teloggo');

const domain = 'My Custom Domain'; // it's about your creativity
const token = 'XXXXXXXX:YYYYYYYYYYYYYYYYYY'; // from BotFather
const chatId = 10000; // if you don't know you can use the teloggo.getId method

var logger = new teloggo({
  domain: domain,
  token: token,
  chatId: chatId
});

// send string
logger.log('Here we are!!!');

try {
  throw new Error('This bad has just happend')
} catch (e){
  //send errors
  logger.log(e);
}

// send object
logger.log({a: 'xxx', b: 1111})

And you'll receive a message on your telegram.

telegram example

How to get chatId

if you want to know the chatId you can write a simple app:

// ./givemeMyId.js

const teloggo = require('teloggo');

const token = 'XXXXXXXX:YYYYYYYYYYYYYYYYYY'; // from BotFather

var logger = new teloggo({
  token: token
});

logger.getId();

then you can send a message to your bot with /getId and run the program you write node ./givemeMyId.js, it will output your chatId

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago