Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 874 Bytes

File metadata and controls

10 lines (6 loc) · 874 Bytes

This is a plugin used on the Västerås Chess Club Website to publish news in the discord server whenever a news post is posted on the website. Only those with a specific role on the server will receive a notification. The plugin should work for other websites using WordPress too.

With this plugin an admin can set a discord webhook in Settings->General. He can also set a discord role, so those with that role gets a notification on discord.

You can see how to create a webhook on the discord server here: https://www.geeksforgeeks.org/websites-apps/how-to-make-a-webhook-in-discord/

When setting Discord role, you need to use the Id of that role. This can be accessed by right clicking on a role in discord and copy Role ID.

This code is inspired by code written by Matt Weber https://badecho.com/index.php/2020/10/20/automatically-posting-wordpress-posts-to-discord/