Skip to content

Create /tarot Command – Inventory-Based Readings with VIP Perks #10

@dalbrechtmartin

Description

@dalbrechtmartin

🔮 Feature: /tarot Command – Inventory-Based Readings with VIP Perks

🧙‍♂️ Purpose

Implement a /tarot command that allows players to perform magical tarot readings if they own Tarot Cards in their inventory.
Additionally, VIP players unlock advanced multi-card readings using AI-generated mystical interpretations (via OpenAI API).


🧾 Requirements

🔐 Access Conditions

  • Users must own at least 1 Tarot Card item in their inventory to use the /tarot command.
  • Only users with the "VIP" role can:
    • Draw multiple cards (2 or 3-card spread).
    • Receive dynamic interpretations using the OpenAI API.

🧙 Basic Reading (non-VIP)

  • Draws 1 random card.
  • Returns:
    • Card image (right side up or upside down), name and interpretation
    • Pre-written description from local JSON

✨ VIP Reading

  • Draws 2–3 cards in a spread (e.g., past/present/future).
  • Sends a prompt to OpenAI (get API Key) with card names to generate an interpretation.
  • Returns a detailed, story-like embed message.

📂 Data Source: Tarot Deck

Store cards in src/data/items/tarot-cards/cards.json.


🧠 OpenAI Integration (VIP only)

prompt = (
  "As a mystical tarot expert, interpret the following cards in a 3-card spread:\n"
  f"1. {card1['name']} ({', '.join(card1['keywords'])})\n"
  f"2. {card2['name']} ({', '.join(card2['keywords'])})\n"
  f"3. {card3['name']} ({', '.join(card3['keywords'])})\n\n"
  "Give a poetic, magical interpretation suitable for a dark-fantasy RPG world."
)

✅ Tasks

  • Check if the player has the "Tarot Cards" item in their inventory
  • Restrict /tarot usage if no cards are owned
  • Allow 1-card reading for all users (local static interpretation)
  • Enable 2–3 card spreads only if VIP
  • Create OpenAI request for VIP interpretation (error message if unavailable)
  • Display results in a stylized embed with emoji, name, and image
  • Add possibility for non-VIP's user to buy divination credits to make VIP reading
  • Add cooldown system (e.g., 1 free reading per day for non-VIP's user)

🧙 Future Features

  • Add in-world consequences from tarot readings (affects quest, XP, etc.)

Metadata

Metadata

Labels

21Upper 9 days of work estimatedBacklogUser story to doenhancementNew feature or requestuser storyObjective to achieve

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions