![]() Inside it I'll create a basic button that executes the JavaScript function sendMessage(). In my case I'll just simply create a local HTML file that I'll name index.html. In order to send POST requests to your webhook, you'll have to set up some form of JavaScript environment in which you can execute code. Copy it and save it somewhere, as we will use it later. Then at the bottom, you'll get the unique Webhook URL. in Select Discord Account you login to discord and add the bot to your server. in Select Discord Action you pick send channel message. in Set up Reddit Post, you type in the name of the subreddit you want the posts from. Again, that image can later be customized from the JSON post request. in Select Reddit Account you login to your reddit account. You can also adjust the channel, and add a default image. You'll then be able to specify the name, which is the name that is used when sending messages if none is specifided in the JSON post request. Then head to the Webhooks tab, and hit Create Webhook. To create a Webhook, click the cog next to the channel in which you wish to set up your Webhook: Basic Webhook from discordwebhook import DiscordWebhook webhook DiscordWebhook(url'your webhook url', content'Webhook Message') response webhook.execute() Create multiple instances If you want to use multiple URLs you need to create multiple instances. ![]() This works by sending a post request with some JSON data to a unique URL Discord provides when you create your Webhook.ĭiscord provides a feature to create Webhooks, but note that it is only available in server channels, not in direct messages. ![]() Let's see how to easily set one up in order for you to integrate it with your app, or even just have fun sending custom messages. Almost completely replicating a Discord user, capable of knowing things such as the server name and channel name. Well did you know that it is possible to send automated messages in Discord servers directly from JavaScript? It's called Webhooks. Discord Webhook URL: This is the most important thing to set up correctly, which you'll need to do to have it message in your discord channel about things, and which I'll explain at the end as you need to do it with the other plugin as well. I'm sure you've heard of Discord, the all-in-one voice and text chat app, and maybe you're even using it. ![]()
0 Comments
Leave a Reply. |