Testing out the daba.so database with a database news bot
A simple database that has a built in api to GET data and POST data into your database in JSON format.
To test the database I built a quick a discord bot to get database related news, store it in a database, and return that data to discord on request
Utilises base discord bot code from TestBot
Gets data from GNEWS
You can see the discord bot in action in my server
or view the widget results over on my page
If you are looking to build your own discord bot I would recommend starting by reading the Discord.js Guide which helped me in building this bot.
- daba.so: This bot utilises daba.so in order to hold data such as the news. In order to replicate this repo you will need your own database.
- node.js: Make sure you have node.js installed
- GNEWS-api: You will need a GNEWS account if you wish to use that api
- Run
npm install
- Create
.env
file to hold your tokens
Set .env variables for the following
- discord_bot_token (from discord developers once you have set up a bot)
- DB_KEY (from daba.so)
- PROJECT_ID (from daba.so)
- guildId (the id for the discord server)
- clientId (the id for the discord bot)
- GNEWS_KEY (from GNEWS)
- Bring discord bot online
npm run start
- /news - shows latest news article with "database" keyword, as embed
- /newsreel - shows latest 10 news articles with "database" keyword, as embed with pagination