I am trying to not use any Google services for notifications and so I’d like to make a script to send notifications via ntfy based on discord messages.
How would I get access programmatically to my own discord account? Do they even support it? They have bots, but is their api for DMs?
Edit: the solution may just be a bot in servers, then not responding to DMs unless they use signal
It is likely not worth your effort as whatever you come up with will likely result in discord deactivating your account for breaking their ToS, or them breaking their API forcing you to constantly play catch-up.
This is why open communication protocols are so important. Email is still as ubiquitous as it is because it’s a protocol, not an API.
I personally think it would be less overall effort to get your friends to switch to an open protocol like matrix, or XMPP than it would playing cat and mouse with proprietary APIs. But you do you, I wish you the best of luck!
https://github.com/matrix-org/matrix-appservice-discord
It looks like there’s software to bridge it to Matrix. I have no idea whether that violates ToS. It does look like it’s getting development, though, so I can’t imagine that Discord has been cutting people off en masse for using it.
you can’t access your own account. you can have a bot sit in the server and read messages, but after a certain number of joined servers you will need approval from discord to continue.
Check out Discord’s Webhooks; many applications publish notifications through them. Should be as easy as sending a message to a specific URL, I think.
Self-boting is against ToS. You have to be careful when interacting with the Discord API. Maybe there is a way to run the discord website to fetch text messages.
Mautrix Discord (look it up)
Oh yea I forgot about matrix. Maybe setting up a bridge would work. Thanks for the reminder I’ll look into this
Mautrix?
Yep
Discord recently added “user installable apps”. You can configure it though the installation context. I have only implemented the usual server installable apps so far, so I don’t know what the apps in the new context are able to do. But it might be worth a look :)