This is a Discord Bot that provides information on the current Apex Legends Map Rotation updates and will send wholesome Gibby TTS messages when you are sad in the chat.
- Use slash command
/map
or type!map
into any channel in the server.This will return the current public and arenas map, their remaining minutes, and their next map.
- Type any text message with the key phrase "sad" (case not sensitive)
This will trigger a randomized wholesome TTS (text to speech) quote by Makoa Gibraltar.
DemoGibbyTTS.mp4
- Discord Account
This project will use the following APIs and free services to run and host the applicationgit
- Clone this project
git clone https://github.com/philliplam8/apexbot-redo-nodejs.git
- Use the package manager npm to install the following dependencies
npm install
IMPORTANT: Ensure the .env file is not made available to the public i.e. not uploaded to a public repository (to workaround this, use a .gitignore file). Your tokens and secrets should be kept hidden and treated like a password as they can be misused. If they are compromised, re-issue a new token/secret from the application accordingly.
- Create an environments variable file called
.env
in the root directory of the project - Copy and paste the following into the
.env
file# DISCORD ----------------------------------------------------------------------- ## Discord Bot Tokens DISCORD_TOKEN = '' ## Discord Bot Client Ids CLIENT_ID = '' ## Disord Server Guild Ids GUILD_ID = '' # APEX API ---------------------------------------------------------------------- APEX_LEGENDS_API_TOKEN = ''
- In the following next steps, we will be adding several environment variables into this file
- Visit third party Apex Legends API
- Follow the instructions on the site and generate an API key
- Copy the API key generated
- Paste the API key into the
.env
fileAPEX_LEGENDS_API_TOKEN
variable
- Visit Discord Developer Portal
- Sign into Discord
- Click New Application
- Create a name and click Create
- Click on the OAuth2 > General settings tab
- In the Client ID section, click Copy
- Paste the value into the
.env
fileCLIENT_ID
variable - Click on the Bot settings tab
- In the Token_ section, click Generate
- Paste the value into the
.env
fileDISCORD_TOKEN
variable - Click on the OAuth2 > URL Generator settings tab
- In the Scopes section, check
bot
andapplication.commands
- In the Generated URL section, click Copy
- Paste the URL into your browser
- Add the Discord bot to your desired server
- Enable developer mode on Discord (see instructions)
- Right click on your desired server and click Copy ID
- Paste the value into the
.env
fileGUILD_ID
variable
Heroku is used here, but feel free to use any hosting method (local, AWS, etc.)
- Visit Heroku and create a new account (or sign in with an existing account)
- Click New > Create new app
- Following the instructions to Deploy using Heroku Git
- Visit the Settings Tab
- Click on Reveal Config Vars
- Copy and paste all key/values from the
.env
file into the Heroku Config Vars section - Click on More > View Logs and ensure the app has been deployed successfully
- Visit Freshping and create a new account (or sign in with an existing account)
- Click + Add Check
- Enter the Heroku app URL into the Check URL field
- Set Check interval = 5 min
- Click Save
ApexBot is licensed under the MIT license