This is a Discord bot that provides earthquake alerts to its users. The bot is built using Node.js v16 and the Discord.js v13 library. It makes use of the USGS Earthquake API to get the latest earthquake data.
The bot has the following features:
- Set a channel where earthquake alerts will be sent
- Set the interval for refreshing earthquake data (in minutes)
- Set the interval for sending earthquake alerts (in minutes)
- Add countries of interest for earthquake alerts
- List all countries currently set for earthquake alerts
- Set the minimum magnitude threshold for earthquake alerts
- Get all earthquake alerts for today
- Get all earthquake alerts for a specific country for today
- Show command help
- Clone the repository:
git clone https://github.com/adnanedrief/Earthquake-Alerts.git
- Install dependencies:
npm install nodemon axios [email protected]
-
Replace the BOT_TOKEN in the config.json file with your Discord bot token.
-
Start the bot:
nodemon app.js
To use the bot, you can use the following commands:
- !alertchannel #channel - Set the channel where earthquake alerts will be sent.
- !refresh - Set the interval for refreshing earthquake data (in minutes).
- !alertinterval - Set the interval for sending earthquake alerts (in minutes).
- !addcountry - Add a country of interest for earthquake alerts.
- !listcountries - List all countries currently set for earthquake alerts.
- !setmagnitude - Set the minimum magnitude threshold for earthquake alerts (default value is 4 ).
- !todayalerts - Get all earthquake alerts for today.
- !todayalertfor - Get all earthquake alerts for a specific country for today.
- !help - Show command help.
demo.mp4
To add this bot to your server, you can use the following link: Add Me To Your Server
Make sure to authorize the bot with the necessary permissions to read and send messages, as well as manage webhooks and embeds. With these permissions, the bot will be able to function properly in your server.
Contributions are welcome! If you have any ideas, feel free to open an issue or a pull request.