Getting started with Discord bot via IFTTT

By Robert Dyjas on  •  Edit this post

If you want to write Discord bot, there are several options for getting started. I'll describe what I checked when I started looking at that.

Note

This article was written in 2018. It stays here for archiving purposes.


If you want your app to post messages to Discord, you can do it with webhooks. Check if your app supports sending requests to webhooks and follow the instructions provided.


Below, you can discover the format required by Discord. Based on the examples, you should be able to adjust it to your needs.

No coding at all

My first attempt was based on Mark Ramsey's article. If you happen to follow Tweets of specific user and post them to your Discord, read it and you're done. However, if you need to do anything else (i.e reposting top Reddit posts from specific sub, getting weather alerts etc.), follow this tutorial.

First, go to creating new applet page on IFTTT. Choose the service:

2018-12-07-12_06_08-Make-an-Applet---IFTTT.png

and specific action (I chose post upvote as it's easy to trigger for testing)

2018-12-07-12_06_29-Make-an-Applet---IFTTT.png

Once you configured the trigger, go to action configuration:

2018-12-07-12_07_16-Make-an-Applet---IFTTT.png

Your actions service will be Webhooks:

2018-12-07-12_07_28-Make-an-Applet---IFTTT.png

In URL field you just have to paste your webhook URL. Do not forget to change method to POST (default is GET):

2018-12-07-12_10_06-Make-an-Applet---IFTTT.png

Content Type should be application/json and in the body you enter the message you want to be sent.

2018-12-07-12_21_29-Make-an-Applet---IFTTT.png

There are two options for formatting your message. The simpler one is to just fill username and content for example with this:

{ "username":"New post", "content":"{{Title}} by {{Author}}" }

which would result in such message:

2018-12-12-09_34_33-general.png

You can use the dropdown Add ingredient to see which fields are available for you and to add them to your output:

2018-12-07-12_23_39-Make-an-Applet---IFTTT.png

If you want, you can also create rich embed (you can take example from here and adjust it to your needs).

Once you're done with the configuration, click Create action, rename your applet if needed and click Finish:

2018-12-07-12_24_29-Make-an-Applet---IFTTT.png

Now you just need to upvote something using your account. You might sometimes use Check now if the applet doesn't run ~~and you're impatient as me~~.

2018-12-07-12_25_29-If-New-upvoted-post-by-_u_robdy,-then-Make-a-web-request---IFTTT.png