djyde / cusdis

lightweight, privacy-friendly alternative to Disqus.
https://cusdis.com
GNU General Public License v3.0
2.61k stars 227 forks source link

I get webhook notified only when I visit the self-hosted cusdis website #183

Open Beiluo-Wang opened 2 years ago

Beiluo-Wang commented 2 years ago

I deployed a telegram bot to notify me of the new comments, which works well with the official cusdis.com. 

However, when I deployed a self-hosted cusdis on Vercel following the documentation, the webhook worked only when I visited the hosted website.

candideu commented 2 years ago

Just tested, and noticed the same issue. Strange because I have the comment counter set up, and it logged the new comment (despite not displaying it), so it might be an issue on the bot's side?

Beiluo-Wang commented 2 years ago

Just tested, and noticed the same issue. Strange because I have the comment counter set up, and it logged the new comment (despite not displaying it), so it might be an issue on the bot's side?

@candideu I find it's interesting that I can also get notification of the "old comment" when I submit a new one. It looks like adding a comment will trigger the webhook, but not with the most recent comment.

I guess a possible reason behind this is the webhook logic. I am not familiar with TypeScript programming. Can anyone check the code for that part?

djyde commented 2 years ago

Is it your telegram bot also self host?

Beiluo-Wang commented 2 years ago

Is it your telegram bot also self host?

@djyde Yes. I cannot get webhook from @CusdisBot. So I deployed a telegram bot myself: https://gist.github.com/Beiluo-Wang/b693e535d9772bfc2aea8c4bbe23bbe9

candideu commented 2 years ago

Is it your telegram bot also self host?

Mine isn't, I'm using the hosted one.