dutu / poloLender

Free, open source, high performance bot for lending funds on Poloniex exchange
https://github.com/dutu/poloLender
Other
160 stars 47 forks source link

telegram to message #59

Closed mostechlee closed 7 years ago

mostechlee commented 7 years ago

I modified logger.js using node-telegram-bot-api but only [info] message to me. how can I receive all message?

use strict;
var winston = require(“winston”);
require(‘winston-telegram’).Telegram;

var logger = new (winston.Logger)({
       transports: [
              new (winston.transports.Telegram) ({
                  token : ‘bot token’,
                  chatId : ‘user_id’,
                  unique : true

              }),

              new (winston.transports.Console)({
                  colorize: ‘all’

              })

                   ]

  });

module.exports = logger;
dutu commented 7 years ago

@mostechlee, you'd need to setup a telegram bot, see How do I create a bot. and then use in the logger setup the details you receive. Let me know how it goes

mostechlee commented 7 years ago

The bot is already running. Now, only [info] messages appear. I want all the messages to come out of the telegram as on the console. Thank you for help

dutu commented 7 years ago

Thanks for your feedback. Use parameter level when you define your telegram transport https://www.npmjs.com/package/winston-telegram

dutu commented 7 years ago

... and set unique to false

mostechlee commented 7 years ago

unique to false option is all... Thank you very much!

dutu commented 7 years ago

the newly release version 0.9.0 support sending the reports to your telegram messenger.

Note that only the reports are sent and not all "info" messages for individual loans.

Hope you'll enjoy the feature as implemented