Skip to content

arckt/rpg-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

RPG Discord Bot

This repository contains the code for an RPG Discord bot that manages a Call of Cthulhu 7e game. The bot allows players to join the game with their character sheets, interact with the game master (GM) through commands, and manage their game sessions.

Features

  • Player Management: Players can join the game by attaching their character sheets.
  • Game Interaction: Players can send inputs to the game from their character's perspective, and the GM provides responses.
  • Admin Controls: Admins can update character sheets, retry the last input, and manage game worlds.
  • Quest Management: Track quests, their statuses, and player progress.
  • Customizable Game Master Prompt: Modify the GM's prompt to tailor the game experience.
  • Image Generation: Generate and send images based on game descriptions.
  • Search Integration: Perform web searches to gather information relevant to the game context.

Commands

Player Commands

  • !join
    • Join the game by attaching a character sheet.
  • !player_input <text>
    • Send input to the game as your character.
  • !notebook
    • View your notebook.
  • !quests
    • View your quests.

Admin Commands

  • !admin_input <text>
    • Send input to the game as the admin.
  • !list_players
    • List all current players.
  • !update_character_sheet <player_name> <update_instruction>
    • Update a player's character sheet.
  • !update_params <json>
    • Update game parameters.
  • !retry
    • Retry the last input.
  • !list_worlds
    • List all available worlds with their summaries.
  • !select_world <world>
    • Select a world.
  • !create_world <world>
    • Create a new world.

Help Command

  • !commands
    • List all available commands.

Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/rpg-discord-bot.git
    cd rpg-discord-bot
  2. Install the required Python modules:

    pip install discord.py duckduckgo-search freeGPT sentence-transformers numpy pillow
  3. Run the bot:

    python bot.py

Configuration

  • Admin User ID: Set the ADMIN_USER_ID variable in the code to your Discord user ID to restrict certain commands to admins only.
  • Bot Token: Set BOT_TOKEN variable in the code the discord bot token.
  • Rulebooks: Add a books directory with the relevant .txt files for lore, then run embedder.py to make the information retrievable.
  • Character Sheets: Players need to attach their character sheets in a format that suits the group's preferences.

Contributing

Contributions are welcome! Please open an issue or submit a pull request with your improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements