Sentinel not triggering notifications to Discord

Hi there!
First of all thanks for making defender, it’s an awesome tool!
I’m seeing strange behavior from Sentinel
I have set up a sentinel on Goerli that should only listen for a specific event on a contract with no added filters, conditions or functions.
I have tested webhook for disc and i get test message fine. If i back test sentinel rule against recent blocks that i know have selected events it finds and shows them correctly but i then get no notifications as they happen.
I also don’t see an option to permanently delete notification profiles, they seem to be retained even after the associated sentinel has been deleted so you can end up with quite a large list to select from(unless i’m missing a delete option somewhere)
Also wanted to report a very minor typo:


EDIT:
Did some further tests and the issue seem to happen specifically with notifications piped to Discord as the rule works when chosing email as a notification method.

1 Like

Hey @spaghetticode! Thanks for reporting the issue. Any chance I can ask you for the tx hashes that you would have expected to trigger the sentinel? Also, can I ask you for your Sentinel’s name in Defender, so I can look for potential errors associated to it in our logs? Thank you!

1 Like

Hi there!
Yes absolutely.
this is a tx that should have triggered the sentinel(and indeed it is picked up if i backtest in recent blocks):
https://goerli.etherscan.io/tx/0xf74c82252a91d85375ec7d7159e997667dd1057246c758537a45895a3ea24cd2
The name of the sentinel is Testsentinel and i can confirm if i click the send test message button i do get a message in discord but not the actual notification for events.
Thanks for taking a look and let me know if you need anything else!

1 Like

Thanks! I’ll look into it and get back to you during this week.

Piggy backing on this one, to debug I have checked EVERY event and function on my contract as conditions, and still events like 2h ago, & such never triggered the Discord hook (or it died silently on your end). Even if they match on the tester

Hey @Elyx0 @spaghetticode I can confirm there is a bug specific to Discord notifications. We have identified it and are working on a fix. Expect it to be in production by early next week.

1 Like

Hey @Elyx0 @spaghetticode this should be fixed now!

1 Like

I have the same problem for telegram. There are no problems on Defeneder as sentinel works correctly with autotask too but no notification to telegram. Test notification works properly

Hi @FreezyEx -

I just sent a DM requesting a few details. When you have some time let’s troubleshoot this.

One thing I’ll mention for Telegram specifically, is that it’s sensitive to the chat ID vs. chat name. If your chat ID is not numerical, try using the numerical ID by performing the curl here:

(substitute in your BOT_TOKEN value)

curl https://api.telegram.org/botBOT_TOKEN/getUpdates

It should return a value like this:

{
  "ok": true,
  "result": [
    {
      "update_id": 98xxxx98,
      "channel_post": {
        "message_id": 26,
        "sender_chat": {
          "id": -100xxxxxx5976,
          "title": "Defender Sentinel Test",
          "type": "channel"
        },
        "chat": {
          "id": -100xxxxxx5976, // <--- This is your chat ID
          "title": "Defender Sentinel Test",
          "type": "channel"
        },
        "date": 1612809138,
        "text": "test"
      }
    }
  ]
}

Then just make sure your notification is configured with that numerical ID.

See here for more info: https://docs.openzeppelin.com/defender/sentinel#telegram_configuration . I look forward to your DM response.

Thanks,
Steven

1 Like