Bonus – Ping interested roles!
Discord has some functionality built in called a Webhook which allows you to get automated messages and data updates sent to a text channel. One of the main things I use Webhooks for is to read calendar events from Google Calendar, send the event to a text channel 15minutes before it starts and ping Discord roles that may be interested in that event. In this guide I attempt to show you step by step how to set that up and the good news is that it is completely free to use.
We will be using the three platforms shown below:
– Google Calendar
– IFTTT
– Discord
The first thing to set up is the Google Calendar https://www.google.com/calendar/
Once there, sign into your google account or register if you are new. Then on the left, next to Other calendars, click the plus sign to add other calendars.
Then go to Create new calendar on the drop down menu.
Lets leave the calendar there for a minute and jump over to IFTTT, IFTTT is a site that helps you automate processes and it allows you to have a certain number of applets running for free. https://ifttt.com/explore
Register or log in to IFTTT then hit create at the top right and then we need to configure it to connect to the services. Where it says “If This” click “Add” and type google calendar into the search. You then need to pick “Any event starts”, this will look for events starting on your calendar. You should then be able to pick your Google Calendar Account, pick the calendar you have just created and select the time you want to trigger this, for online gaming stuff etc I normally go for 15mins or 30mins to give people warning that something is happening soon. If its a real life meet up you may want to trigger it a day or two before the event.
The next part we need to configure on IFTTT is the “Then That” but we need to set up the webhook in Discord first. On Discord, right click your server then go to Server Settings -> Integrations. Then on webhooks go to view webhooks and click “New Webhook”. This should create one, you can name it and pick which text channel it should post the event information on. Then all you need to do is copy the Webhook URL and we can go back to finalising our IFTTT settings.
On IFTTT “Then That” click “Add” and type “webhook” into the seach box. Pick webhook then click “make a search request”. In the URL box paste in the URL you copied from Discord. Set method to post, content type should be set to application/json and in body type what you want the message to be when the event starts, something like this:
{"content":"Our {{Title}} event is due to start in 15 minutes! {{Description}}"}
Doing that will pull the title and description from the Google Calendar entry automatically!
Once you have clicked create action that is the IFTTT setup complete. Click continue and finish on IFTTT, you can change the title of the applet if you want to. Now all you need to do is add some events to your Google Calendar and test that it works!
Bonus – With a little more setup you can make it automatically ping or tag Discord roles at the same time. In the above we added the {{Description}} part to IFTTT, this will relay whatever is in that description box on the google calendar event. We will use this to put the role information in. First thing you need to do is go to discord and check you have set it into developer mode. Go to settings -> Advnaced then toggle the developer mode setting to turn it on. Then you should be able to right click your server, go to settings -> roles and right click the role you want to ping and click copy ID.
Now if you paste that it will give you a load of random numbers like 513344460535674883. This on its own will not work but if you put it in the proper syntax <@& 513344460535674883 > then it should. Simply paste that into the description box of the event and it will ping that roll before the event starts.