This is a simple Discord bot project already configured to work by just following some steps:
- Follow the instructions in Step 1 to create your own bot using your Discord accout and generate a Token
- Create an
.env
file and paste your token using the.env.dist
variable name givenBOT_TOKEN=YOUR_TOKEN
. - Invite the bot to your Discord channel and run it using
npm run start
ornpm run dev
.
To create new functions just replicate some of the files in the handlers
folder and import it in index.js
.
In order to connect your project with Firebase you should first download your admin credentials in json
format from Firebase Control Panel.
Update the environment variables in the same order as they are in env.dist
but in your own .env
file to connect with the firebase services you want to use.
- !!help => Returns all available commands.
- !!subjects => Returns all subjects some user has worked on.
- !!latest => Returns the latest work session for this user.
- !!me => Returns user id, username and discriminator.
- !!ping => Returns the bot answer latency and a link to download your current user avatar.
- !!start => Generates a new session document in Firebase with the current working session
startTime
andsubject
. Also appends theworkingRole
you configured in your server to the current user. - !!stop => End the previous session document in Firebase with the current working session
endTime
andtimeSpent
.
In case any user disconnects while having workingRole
active, Alpaca Work Bot will automatically run the stop
handler for that user.
- Stop dyno:
heroku ps:scale web=0
- Start dyno:
heroku ps:scale web=1