-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reformat notificatiers code, add telegram library and support, add discord webhook support #101
Conversation
I really appreciate the PR! However, I'd like to fix #97 before merging this. I like the We'll have to make sure we update the Readme and clarify these options. |
Take your time! I tried to clean up code where i can in my last commit, i hope you like the changes. |
Small update: I build and deployed this version locally, with telegram enabled, and it seems to be working as before. |
This PR is awesome. Tho something I might want to say. I don't know if it's just me but personally I like adding big requirements for small things that could be easily done manually with the already existing features. A simple send message over telegram could be done by easily making a post request to the bot API. https://api.telegram.org/botTELEGRAM_BOT_TOKEN/sendMessage. Here's a curl version for it: https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1 Anyway I'm waiting for this PR to be a thing since I'm not reading my emails so often and usually I ignore notifications from it ^^ |
@nitanmarcel Yeh you are completely right, got a little bit sloppy there. I removed the library and exchanged it for the post call. |
@mikhail5555 I noticed you're missing the docker configuration in Readme.md. Also I couldn't notice you removed the markdown in the message which can be still used with |
Until then I wanted to try this PR so I merged it and your latest changes in a fork I'm having in sr.ht. So far it works nice excepting that the login by completing the captcha doesn't work, but I still have to try with your own to know where's the problem. Anyway, if someone is interested : https://git.sr.ht/~nitanmarcel/epicgames-freegames-node-telegram |
Yeh didn't fully update the documentation yet, will do that once i have a little more time. I though i had a reason to remove the |
With thoughtful documentation, the Discord webhook could also be used with custom web servers to initiate appropriate actions. |
Yes, any url which accepts a post request which is equal or atleast a little comparable to discord one could be the endpoint of that call. That's the reason why I let the user edit the whole webhook url and not just the discord specific webhook keys. However as I noticed many webhooks have just a slightly different protocol, so that's why I decided to make it named 'discord' and not just type 'webhook' since then you would need some more service specific webhook configuration. |
Oh and I indeed also forward the 'account' to the notification handler, so it would indeed be trivial to make a notifier per account, the biggest problem I encountered on that part was that I was very hard to make it good user configurable without hardcoding it in the code. |
…rdanly, split up some models from files
@Wunderharke I added a tiny bit of placeholder logic for your feature request e68c582 |
So I think I finished the work for this in the v4 develop branch: cb8fd0c Since I radically redesigned the config parsing, not much of the original code was left in-tact. However, the notifier config structures and each service implementation was very useful. I'm pretty sure this PR should mark as merged when I release v4 to master. I really appreciate your work on this, and I'm glad I could finally get a look at it. Thanks, @mikhail5555 |
I'm happy it was useful! |
New config options:
To generate TelegramBotToken: https://sendpulse.com/knowledge-base/chatbot/create-telegram-chatbot
Then start chat with the bot, and send it a message.
Then go to:
https://api.telegram.org/bot<TelegramBotToken>/getUpdates
And get your chatId.
I have tested this local running Node v15, and in docker.
