Can be installed with npm install <package>
- Discord.js
- @discordjs/rest
- pg
- sequelize
- axios
- cheerio
- node-schedule
Create a config.json
file with the following format.
{
"token": "bot token here",
"clientId": "oath2 client id here",
"guildId": "testing server guild id here",
"adminRole": "role name here, for running certain commands",
"logChannelId": "channel id for the logging channel, bot must already be in the server"
}
These slash commands can be uploaded to a testing server using the deploy-commands.js
script, given that the server guildId
is saved in the config file and that the bot has been invited to the server with the slash command permission. Run using node deploy-commands.js <flag>
with up to one flag at a time. The commands uploaded to a test server will all have "dev" added to the end of their descriptions, to distinguish between previously uploaded global commands.
- None: Default, uploads commands to a guild for testing
-g
: Uploads commands globally (may take an hour to reflect on Discord)-ct
: Clears testing commands from the test guild (does not remove global commands)-cg
: Clears global commands (may take an hour)
This application is containerized, so Docker
must be started before running docker-compose up -d
. The application runs in a NodeJS
container named chefwildcat
, and the Postgres
database is in a container named pgdb
. For testing, the docker-compose up --build
can be used to follow the outputs of the containers. Additionally, docker-compose up -d --no-deps --build <service>
can be used to rebuild and restart a single service rather than building and restarting all of the containers in the docker-compose file.
The following commands are implemented in this bot:
A simple ping-pong command for testing if the bot is running.
Displays the given menus for the day for Philbrook dining hall.
Displays the given menus for the day for Holloway Commons dining hall.
Displays the given menus for the day for Stillings dining hall.
Displays the given menus for the day for breakfast.
Displays the given menus for the day for lunch.
Displays the given menus for the day for dinner.
Marks a menu item as a favorite. Only available in DMs.
Unmarks a menu item as a favorite. Only available in DMs.
Displays the favorited items list. Only available in DMs.
A command for testing
Toggles the daily subscription for a given hall in a given channel or direct message.
Refreshes the subscribed menus for the subscriptions in the given channel or direct message.