Minecraft-Console-Client icon indicating copy to clipboard operation
Minecraft-Console-Client copied to clipboard

using discord webhooks on events

Open Entriquietal opened this issue 3 years ago • 2 comments

So I looked at the discord webhooks chatbot script and it seems to just be a relay mechanism for server messages to the discord server

I am using something similar to the example script sample-script-with-world-access.cs, where it watches for a lamp to turn off. does anyone know how to send a webhook to the discord server when the condition is met?

LogToConsole("Lamp at " + lampLoc + " is currently turned OFF !!!");
for (int i = 0; i < 3; i++)  
// SEND TO DISCORD SERVER HERE SOMEHOW  
break;```

Entriquietal avatar Feb 11 '22 22:02 Entriquietal

Currently that's not possible but I think if you're willing to improve the bot, you could add a command inside /discordwebhook like discordwebkook send <message> so that you can call it from your script.

ORelio avatar Feb 12 '22 16:02 ORelio

You can also just copy this function and replace some variables (such as the webhook url) with some hardcoded values. Then you can directly send messages to a webhook. I can recommend this video. Although it is in german, you should be able to recreate what he is doing there.

Daenges avatar Feb 12 '22 19:02 Daenges