Skip to content
Gerald McAlister edited this page Jan 30, 2023 · 6 revisions

Welcome to the Captain Chris Bot wiki! This wiki covers everything you need to know about the bot, and can help get you up and running!

What is the Captain Chris Bot?

Captain Chris is the Mascot of Christopher Newport University (CNU), named after Christopher Newport. The Captain Chris Bot is a chat bot meant for services like Discord and Slack, allowing you to issue it commands. It contains a variety of commands relevant to CNU students, alumni, and other friends of the university. Servers that have the bot available on it get access to a variety of commands from it, including (but not limited to):

  • hello: Has the bot simply say hello to you
  • poke: Takes another user as an input and "pokes" them
  • whoareyou: Gives a brief description of the bot.

Quick Start

Looking to get up and running fast? Here are the relevant pages to get you building commands quickly:

Diving Deeper

If you're looking to dive deeper into developing the bot, here are some things to look at to get going:

Contributing

Anyone is welcome to contribute to the bot's development by submitting a pull request to the project. The bot is kept open source so that anyone can see the code and audit it, as well as utilize it however they want. If you plan to contribute new commands to the project, please make sure to lint your code using npm run lint and fixing any errors that appear. Also ensure that you have added proper tests for your command, and that npm run test succeeds fully. If you are not sure why your tests are not getting full coverage, you can find the full details of what is tested in the generated coverage/lcov-report/index.html file once you have run the tests.

Useful commands

For testing, use the following commands

  • npm run test perform the jest unit tests and output coverage
  • npm run command <json_data> runs a desired command locally.
    • <json_data> should be in the format of a IDiscordRequestData object, for example: '{"name": "hello"}'.

For deplying, use the following commands

  • npm run build compile typescript to js
  • cdk synth emits the synthesized CloudFormation template
  • cdk deploy deploy this stack to your default AWS account/region

For keeping the code clean, use the following commands

  • npm run lint runs linting across the code
  • npm run fix-lint fixes any lint issues where possible across the code
  • cdk diff compare deployed stack with current state

Run the following to manage slash commands

  • npm run configure <secrets_name> sets up the slash commands using the secret keys in CDK.
  • npm run reset <secrets_name> resets the slash commands using the secret keys in CDK.