Crypto-Signal icon indicating copy to clipboard operation
Crypto-Signal copied to clipboard

Notif for Slack work but for telegram not enable

Open yohukm opened this issue 6 years ago • 17 comments

i using this setting

notifiers: slack: required: webhook: https://hooks.slack.com/services/T87HUE084/B88E01AF8/XXXXXoeV0fk81YgdXGD6CSs optional: template: "{{exchange}}-{{market}}-{{indicator}}-{{indicator_number}} is {{status}}!{{ '\n' -}}"

telegram:
    required:
        token: 556960520:AAF-uECdDAL7yqxRb3PkiYWGfV3-_XXXXXX
        chat_id: -1001353606xxx
    optional:
        parse_mode: html
        template: "{{exchange}}-{{market}}-{{indicator}}-{{indicator_number}} is {{status}}!{{ '\n' -}}"

for slack work but for telegram nothing happen

yohukm avatar May 13 '18 13:05 yohukm

There's no error message, just no output? Does it say in the startup messages that the notifier is enabled?

ghost avatar May 13 '18 21:05 ghost

yes after i put chat id
enable notifiers slack and telegram
but no message sent to telegram

yohukm avatar May 14 '18 20:05 yohukm

same here. enabled notifers: ['telegram'] but i never get any messages.

december-soul avatar May 14 '18 21:05 december-soul

Thanks! I should have this sorted in the next couple of days

ghost avatar May 15 '18 06:05 ghost

I have to improve, I works for me. (i just use telegram, not slack and telegram like yohukm)

for testing i have added


----------------------------- app/notification.py -----------------------------
index 258faae..3fbc3b3 100644
@@ -71,6 +71,7 @@ class Notifier():
                 chat_id=notifier_config['telegram']['required']['chat_id'],
                 parse_mode=notifier_config['telegram']['optional']['parse_mode']
             )
+            self.telegram_client.notify("crypto-signal is up")
             enabled_notifiers.append('telegram')
 
         self.webhook_configured = self._validate_required_config('webhook', notifier_config)

i saw that the crypto-signal app send successful a message. after that I realized that there were just no messages to send.

Worksforme

december-soul avatar May 15 '18 07:05 december-soul

Thanks for the further update!

ghost avatar May 15 '18 12:05 ghost

Just to make sure all of the conversation is present here:

[10:27 AM] jsmurphy: @yohukm For your open git issue, does the issue with telegram occur always, or only when you have both slack and telegram enabled?
[10:43 AM] yohukm: i always use both, i will try  telegram only
i make bot   privacy disable   invite to super group    , find id  group     invite bot
now try to use only telegram

ghost avatar May 16 '18 00:05 ghost

This issue seems to occur only when multiple notifiers are configured. I will continue to investigate the root cause.

ghost avatar May 16 '18 06:05 ghost

Maybe you can test this. just to get closer to the problem

index 258faae..1427887 100644
--- a/app/notification.py
+++ b/app/notification.py
@@ -92,11 +92,11 @@ class Notifier():
             new_analysis (dict): The new_analysis to send.
         """
 
+        self.notify_telegram(new_analysis)
         self.notify_slack(new_analysis)
         self.notify_discord(new_analysis)
         self.notify_twilio(new_analysis)
         self.notify_gmail(new_analysis)
-        self.notify_telegram(new_analysis)
         self.notify_webhook(new_analysis)

december-soul avatar May 16 '18 07:05 december-soul

I don't think it's related to multiple notifier config setup, I have the same issue. No messages in telegram chat with only telegram configured. I think it's not sending anything because there is nothing to send for some reason. config file structure I use:

settings:
   update_interval: 100

exchanges:
    binance:
        required:
            enabled: true

notifiers:
    telegram:
        required:
            token: abcd1234
            chat_id: abcd1234
        optional:
            parse_mode: html
            template: "{{exchange}}-{{market}}-{{indicator}}-{{indicator_number}} is {{status}}!{{ '\n' -}}"

ikwtif avatar May 16 '18 17:05 ikwtif

I found my "issue" at least, not sure if it is completely related to OP as it is a misinterpretation of how alerts work. The config always defaults alert_frequency: once so there is no alert on the first run trough. I tried it a few months back and just got instant messages on telegram so I guess this was something that changed and I overlooked. Makes sense in hindsight. Probably should have read the docs more carefully. Might be good to add to the doc as I see alert_frequency not really explained in there to let people know you can just set it up so you get messages every interval of the script. It's only briefly adressed in Notifier Templating

ikwtif avatar May 16 '18 21:05 ikwtif

Glad you resolved your problem, the docs are definitely not as clear as they could be. I do my best to keep them usable, though I have a very limited amount of time to work on this project and truly good documentation takes a long time to write.

I do however happily accept PR's on documentation improvements

ghost avatar May 16 '18 22:05 ghost

i use only telegram and work for chatid it must group and supergroup
chat id for group have "-" here my config i make 3 for 3 folder all for telegram https://pastebin.com/qymEwn1X https://pastebin.com/f7EivneV https://pastebin.com/BMYWVUC7

here my config .yml 1 binance bittrex split 1 config 90 coin make 3 folder binance bittrex1 bittrex2

yohukm avatar May 17 '18 07:05 yohukm

Root cause identified, basically because the notifiers run sequentially it thinks that it has already notified on the status by the time it gets to the second notifier in the chain. I am going to work on a fix this weekend.

ghost avatar May 18 '18 01:05 ghost

I've made a couple of attempts at patching in a quick fix for this, I think this is actually going to require a more drastic re-write to the notifier class than I was initially thinking. It will still get fixed... just take a little while longer before I really have time to re-evaluate what the best way to do that is.

ghost avatar May 29 '18 12:05 ghost

So what's odd for me is that I have Telegram first and gmail second, but I only get the notifications in gmail.

keithfawcett avatar Jun 02 '18 22:06 keithfawcett

They do not execute in the order they are provided in the yaml file, the order is pre-determined in code.

ghost avatar Jun 02 '18 22:06 ghost