whittlem / pycryptobot

Python Crypto Bot (PyCryptoBot)
Apache License 2.0
1.97k stars 738 forks source link

Less Spammy Telegram #323

Open rcarmo opened 3 years ago

rcarmo commented 3 years ago

Is your feature request related to a problem? Please describe. Please disable candlestick detection messages in Telegram, since they can be quite spammy.

Describe the solution you'd like A flag to mute them, set to default

Describe alternatives you've considered Hacking that out of the code

emreeroglu commented 3 years ago

This will be configurable when Telegram integrated with logger. So user will be able to pick which level of logs to get Telegram. Telegram (in general Chat) logs may be have a separate log level than logger so chat configuration would have a little more detail.

whittlem commented 3 years ago

I agree with @rcarmo that candlestick detection messages are spammy as a default. As a default Telegram should only be receiving buy and sell events. @emreeroglu if the user wants to receive more verbose messaging then they could increase the logging level as you describe. Are you able to help me remove those spammy messages as a default?

emreeroglu commented 3 years ago

I would like to help, have some design ideas but need to finalize those and discuss with you so we can be future proof about possible new chat clients.

hebawom commented 3 years ago

I was at a wedding the other day and my watch kept pinging me candlesticks!

devinat1 commented 3 years ago

I am writing this comment in agreement that it would be nice to customize which types of messages to receive from telegram (via the JSON file for example).

Nicolas469 commented 3 years ago

Any progress here ? I think that we have two options: one flag to disable candlestick detection or add a notification level.

loomsen commented 3 years ago

I was thinking about implementing telegram (and possibly other messengers) as logging handlers in python. Did a quick proof of concept:

image

Leads to: image

So we could just use log.debug, log.error, log.info etc and let the handlers handle it. Console Handler will log to stdout/stderr, filehandler will log to file, and $messengerHandler will send messages to $messenger (extendable, we could easily add more messengers). Also each Handler could have its own level, so telegram could have a higher level than log file, and the ConsoleHandler could have the lowest level, as an example. Didn't have the time to implement, but it's not exactly rocket science, so if someone wants to...