Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 1.23 KB

File metadata and controls

25 lines (21 loc) · 1.23 KB

Personal Discord Bot Edi (Formerly Jarvis)

My personal discord bot used to call apis and provide generic text responses to human readable messages instead of typical bot commands.

How to setup

  1. Clone the code to the desired host machine
    • Edi is made and tested on Java21
  2. Set environment variables
    • Set COLLECTION to your desired personal folder of images
    • Set JARVIS_TOKEN to your discord bot token
    • Set UNSPLASH_TOKEN to your unsplash api token (https://unsplash.com/)
  3. Execute mvn package
  4. Run jarvis-jar-with-dependencies.jar with Java
    • If using Linux with screen installed, execute the included run.sh

Adding new commands

  1. Create a new class with an action method that returns a MessageContent object
  2. Update STRING_ACTION_FUNCTION_MAP in the ActionConstant.java file with a new List that links strings to the newly created action

Edi will now accept the new action, no other changes are needed.

Interacting with Edi

Send a message in a chat containing Edi that follows the parse structure below:

  1. Check that first word is the bots name
  2. Read the message until finding a valid action trigger word
  3. Read the rest of the message after the trigger word to add context to the request