Using Powershell to hit a webhook
I'm trying to use powershell (my most competent language) to hit a webook when a server has a new file. i'm getting a resposne to say the message is empty, however... if i use powershell to spit out the json, and use something like postman, it works fine... any tips?
Hello!
I'm trying to build a simple event watcher for one of my Dnd groups on discord, so they can be notified when i upload new materials to our shared server. unfortunately, there appears to be a bug in how discord receives the invoke-restmethod from powershell. anyone here tried this before?
Here's my test code, and the error response
$webHookUrl = "https://discordapp.com/api/webhooks/``XXXXXXXXXXX
$payload = "{""content"": ""Yarr! there's a new file available for $campaign, check it out, ye land lubber!""}"
Invoke-RestMethod -Uri $webHookUrl -Method Post -body $payload
Invoke-RestMethod : {"message": "Cannot send an empty message", "code": 50006}
-
This is a place for suggestions, not a forum. Ask stackoverflow or a programming discord.
2 -
Good
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires