All PRs merged to main go live instantly! So if you'd like a new bot feature in this discord, add it yourself 👀
In all examples below, the prefix has been set to $
Displays the list of commands. Optionally adding a command name will make the bot respond with details about the named command.
Example:
$help prefix
Updates the prefix which bot will listen to for executing commands.
This prefix should be a single, non-alphanumeric character,
and it should not be one of @
, /
, or #
.
Example:
$prefix !
!help
Whether the bot should be able to trigger itself.
Example:
$recursive true
What is says on the tin.
Example:
$kill
- Mention: Mentioning the bot in a message to a server channel will have it reply to you with usage instructions
To contribute just make a PR into the main
branch!
- Click
Fork
button in the top right of the GitHub page - Develop your feature and push to your fork
- Click the
Pull requests
tab and then theNew pull request
in your fork - Set the base repo and branch to be this repo and
main
- Click
Create pull request
- Create a
.env
file and put it in the root directory of the project.- This file should never be committed to version control.
- Copy
.env.sample
to the new.env
file. - Modify as necessary to your environment.
yarn install
: Gathers all dependencies. This should be run at the start of development on a new clone in the root.yarn build
: Compiles the.ts
files to.js
files in thedist/
dir.yarn lint
: Lints thesrc/
files.yarn start
: Runs the bot.yarn watch
: Runs the bot and restarts it if any files are changed.
To create a Listener or Command:
- Create a file in either the
src/listeners
orsrc/commands
directory - Import the type
Listener
orCommand
from"@ubccpsc310/bot-base"
- Create a
default export
which is of typeListener
orCommand
Additionally, available to you is the function getDatabase()
which provides an object for storing arbitrary JSON in arbitrary tables.
More information is found in the bot-base
documentation.
See also