Galnet News Discord Bot
This bot primarily uses the official API provided by Frontier Developments, at: https://cms.elitedangerous.com/api/galnet
Links:
For any status updates, I may post something at one of the previous links, or at my Twitter:
Appearance
Want to modify and run your own instance?
Since this bot was made with Node.js, you'll need to make sure to install the latest LTS version as that's what I've been using with this project.
Initial Setup
- If you don't already have git installed, please do so, and then run
git clone https://github.com/Andrew-J-Larson/galnet-news-discord-bot
.
- Then, before trying to run the bot, you'll need to go into the folder and update the packages by running
npm update
.
- Make sure you already have filled out a new developer application with discord so you can retrieve the bot token, to put into config in the next step.
- You'll need to go to the directory above the git clone (e.g.
../galnet-news-discord-bot
), and create a file named galnet-news-discord-bot.config
containing the following, while replacing [YOUR BOT TOKEN HERE]
with your application's bot token:
{
"BOT_TOKEN": "[YOUR BOT TOKEN HERE]"
}
- Afterwards, you can go back into the git clone and start the bot with
npm start
. * Not required, but I recommend using pm2 (or another production process manager) for node, as it'll make headless setup a lot easier.
- Lastly, you'll need to go back to the developer applications website so you can create the bot invite link. I suggest using the permissions code
523328
, but at this time it only needs permissions for viewing channels, sending messages, embedding links, attaching files, using external emojis, and mentioning @everyone
/@here
/all roles. You'll want to make sure to also have the scope set to bot
.
- Then you can use the link, which should look something like
https://discord.com/api/oauth2/authorize?client_id=[your-client-id]&permissions=523328&scope=bot
, to add it to one server.
Node.js Libraries Used
- discord.js - A powerful JavaScript library for interacting with the Discord API.
- node-fetch - A light-weight module that brings the Fetch API to Node.js.
- rss-parser - A lightweight RSS parser, for Node and the browser.
- html-to-text - An advanced html to text converter.
- moment - Parse, validate, manipulate, and display dates in javascript.
- moment-precise-range-plugin - A moment.js plugin to display human-readable date/time ranges.
- sync-rpc - Run asynchronous commands synchronously by putting them in a separate process.
Buy me a cup of coffee?