Discord Webhook

by Kaiochao
Demonstrates how to send messages to Discord. [More]
To download this demo for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Kaiochao.DiscordWebhook##version=1

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Kaiochao.DiscordWebhook##version=1

42 downloads
Version 1
Date added: May 3
Last updated: May 6
1 fan
Demonstrates how to send messages to Discord via Webhook.

5/6/2019 - KeyInfo now applies ckey(). (Lummox JR)

Comments

MrStonedOne: (May 18, 6:50 am)
Most apis are https only for security reasons (not sending the auth credentials in plain text keeps them from having to deal with support tickets related to snooped credentials)

Unsecure hacks like this are going to be standard up until byond gets native https support, as well as http method and header support.

In current byond, its impossible to use most apis.
Lummox JR: (May 6, 11:23 pm)
Oh, you make a good point there. The JS in the implementation does tend to eliminate the possibility of keeping it all on the server.
VolAs: (May 6, 11:13 pm)
Still, the server sends url to client to execute js script.

While the request to discord api is executed by the client, client can intercept and analyze this request with some special programs.

Another variant is perhaps get address by manipulating client's cache/skin. In the demo though it's hard to achieve, but in some cases it is still an option.

It's better to use for this some server side script with shell() or library with call()
Lummox JR: (May 6, 1:17 pm)
In the code the client doesn't have access to the hook URL; only the server does. As long as the game isn't one that's distributed and you control hosting in-house, there shouldn't be an issue.
VolAs: (May 6, 4:31 am)
It's not a good idea to give client an hook url. Knowing the address client can abuse it.