Discord bot for compsigh, the social computer science club at the University of San Francisco.
This bot is built using Discord.js and TypeScript. Deployed using Railway.
- /ping: Replies with "Pong!".
- /petfaadil: Pets Faadil and returns a random image of him.
- /contribs: Replies with the contribution graph for the given GitHub account.
- /workingon: Sets the project that you are working on to be displayed on the compsigh website's community page.
- Leadership Only
- /workingon-ban: Bans the user from using the /workingon command.
- /workingon-remove: Removes the /workingon entry made by the user.
- /workingon-unban: Unbans the user from using the /workingon command.
Contributions welcome! Feel free to make issues or pull requests. If you want to make your own feature, I would recommending messaging a leadership member first to make sure it's something that could get merged.
-
Fork the repo and clone.
-
Install dependencies (install pnpm first if you don't have it):
pnpm install
-
Create a
.env
file in the root directory with your own variables:DISCORD_TOKEN="" GITHUB_TOKEN="" MARQUEE_API_KEY="" MONGO_URI=""
-
Make a testing server with your version of the bot.
-
In
src/index.ts
, update the applicationId and add your server to the whitelist. -
Run the bot
pnpm run dev
To add more commands, follow these steps:
- Create a new file in the
src/commands
directory, e.g.,newcommand.ts
. - Define your command using the
SlashCommandBuilder
and implement theexecute
function. The ping is a good example to get started. The discord.js guide may also be useful, see: https://discordjs.guide/creating-your-bot/slash-commands.html#individual-command-files - In
src/commands.ts
, import your command and add it to thecommands
array.