Sending bot updates to discord using webhooks

Asentrix

Asentrix

Administrator
Owner
Developer
Messages
303
Joined
Oct 2, 2019
Reaction score
78
Points
28
Credits
33,347
Finally got around to making a guide for this, it's actually pretty easy!
Here's the step by step guide

For starters, create your own discord server for sending messages too.
Once it's created and you've configured your channels, open up the discord server settings.
Navigate to the "Webhooks" section and create a new webhook.
Select the channel you want to send the webhook messages too, you can create multiple webhooks/channels later.
Your webhook should look something like this
1585343593239.png

Now that you've created the webhook, you need to integrate the code into your winautomation projects.
Open your winautomation script, and go to where you want to send a message in your script.
Once there, drag and drop a "invoke web request" action.
Under the "advanced" tab, make sure to untick encode request body!
Customize the invoke web request action with the following.

Code:
Method: POST
Accept: application/json
Content Type: application/json
Custom Headers: (blank/leave it empty)

The main body request is highly customizable, it may look overwhelming but I will explain it all.
The following code goes into the "Request Body" section.

JSON:
{ "username": "Botting.RS", "avatar_url": "https://www.less-real.com/imagevault/uploaded/images/part2/7284.jpg", "content": "Text message. Up to 2000 characters.", "embeds": [ { "author": { "name": "Asentrix", "url": "https://botting.rs/", "icon_url": "https://botting.rs/data/avatars/s/0/1.jpg" }, "title": "Title", "url": "https://google.com/", "description": "Text message. You can use Markdown here. *Italic* **bold** __underline__ ~~strikeout~~ [hyperlink](https://google.com) `code`", "color": 15258703, "fields": [ { "name": "Text", "value": "More text", "inline": true }, { "name": "Even more text", "value": "Yup", "inline": true }, { "name": "Use `\"inline\": true` parameter, if you want to display fields in the same line.", "value": "okay..." }, { "name": "Thanks!", "value": "You're welcome :wink:" } ], "thumbnail": { "url": "https://upload.wikimedia.org/wikipedia/commons/3/38/4-Nature-Wallpapers-2014-1_ukaavUI.jpg" }, "image": { "url": "https://upload.wikimedia.org/wikipedia/commons/5/5a/A_picture_from_China_every_day_108.jpg" }, "footer": { "text": "Woah! So cool! :smirk:", "icon_url": "https://i.imgur.com/fKL31aD.jpg" } } ]
}

Once that's finished you can go ahead and close the invoke action, and run it.
The end result looks something like this
1585343997268.png

If anyone has any questions or has any issues just let me know!
 
Last edited:
Top Bottom