4 ms·
Personally I have a flask app deployed on heroku that posts a message to a Discord webhook just by visiting an url. So in my case when I use ssh to run long tas
by TrianguloY 6y ago
Personally I have a flask app deployed on heroku that posts a message to a Discord webhook just by visiting an url. So in my case when I use ssh to run long tasks I have at the end "curl https:// https:// <server> .herokuapp.com/?Finished" and as soon as that commands is executed I receive a message either at my phone or computer (through a channel in a personal discord server).
Probably is a bit of a 'hacky' way, and using different proprietary services (heroku and discord) but it works, does it fine, and it's free! (And it was also funny and quick to develop by myself).
The source code is on Github too! https://github.com/TrianguloY/ping https://github.com/TrianguloY/ping
- petethepig 6y agoThis is a cool idea, I've always wanted to expand this kind of thing to other similar usecases like getting notified after long CI jobs. I think the repo is private though.
- TrianguloY 6y agoOuch, thanks for noticing, should be public now. I also made a similar service in the past for Heroku webhooks, to be notified with heroku apps status. Github already have one built-in. https://github.com/TrianguloY/webhook-discord https://github.com/TrianguloY/webhook-discord Webhooks are a really interesting feature!
- yyx 6y agoI have a similar thing with telegram bot: https://pastebin.com/Ei3hjcKa https://pastebin.com/Ei3hjcKa Written in Go so it's static and portable.
- swiley 6y agoThis seems a little over complicated since curl itself could just post to discord.
- TrianguloY 6y agoI guess so, the app is simply a middleware and if you check the source code it is basically a fetch to the discord api url with the specific json it needs. But personally I made it for two reasons: no need to know the discord webhook api (a long alphanumeric url) nor the json required, so I can use it wherever I want without having to remember almost anything; and as a url to be able to use it from any internet-connected thing, not only with curl, even the browser if you want.