Unturned News Service is a small service that simply tracks the SDG blog, and in the future it will track the Steam news page, and posts a webhook to Discord everytime a new blog or news item is posted.
I would suggest reading this post to learn how to create webhooks for Discord: https://github.com/SomeCatIDK/Unturned-News
- Latest version of Node.JS installed.
- Latest version of git installed.
- Latest version of npm installed.
- A MySQL v5.x server.
- To begin clone this repository with the following command:
git clone https://github.com/SomeCatIDK/Unturned-News
- Navigate to the folder it cloned:
cd Unturned-News
- Install dependencies using npm:
npm i
- Open
src/config.ts
with whatever text editor you prefer and enter in the MySQL connenction info and webhook info.
The default file should like like this:
export default {
MySQL: {
address: "localhost",
database: "unturned-news",
password: "toor",
port: 3306,
table_prefix: "u_",
user: "root"
},
Webhook: {
blogpost_webhooks: [],
checktime: 30
}
};
To add a webhook to use for the blogposts, add a string into the blogpost_webhooks
array using the "
marks in the following style: "<WEBHOOK_ID>/<WEBHOOK_TOKEN>"
Note that your webhook ID and webhook token are the last two routing paths of the url, so that the following url: https://discordapp.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890
would look like this: 1234567890/abcdefghijklmnopqrstuvwxyz1234567890
in the config.
Here's an example after adding a fake webhooks:
export default {
MySQL: {
address: "localhost",
database: "unturned-news",
password: "toor",
port: 3306,
table_prefix: "u_",
user: "root"
},
Webhook: {
blogpost_webhooks: [
"1234567890/abcdefghijklmnopqrstuvwxyz1234567890"
],
checktime: 30
}
};
- Build the bot:
npm run build
- Start the bot:
npm start
- That's it! Hope everything goes well, and stay unturned! :D