- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8
feat(tarot): 完整塔罗牌占卜系统 - 78张牌库、多种牌阵、时间限制 #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…me restrictions Co-authored-by: g1331 <[email protected]>
Co-authored-by: g1331 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a comprehensive tarot card divination system, expanding from 26 cards to the standard 78-card deck with multiple spread types and intelligent time restrictions.
Key changes:
- Expanded card library from 26 to 78 cards (22 Major Arcana + 56 Minor Arcana)
- Added new divination types: daily fortune, three-card spread, Celtic cross, and card lookup
- Implemented time-based restrictions using database tracking to prevent overuse
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description | 
|---|---|
| statics/tarot/tarot.json | Expanded card data from 4 to 56 Minor Arcana cards with standardized meanings | 
| modules/self_contained/tarot/metadata.json | Updated version, display name, and comprehensive usage documentation | 
| modules/self_contained/tarot/init.py | Added new divination methods, database integration, and time restriction logic | 
| core/orm/tables.py | Added TarotRecord table for tracking user divination history | 
| "normal": "物质世界的新机会,财富的开始,事业的种子。", | ||
| "reverse": "错失的财务机会,物质欲望,贪婪。" | 
    
      
    
      Copilot
AI
    
    
    
      Aug 11, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The card meanings for different suits (pentacles, wands, cups, swords) with the same numbers are nearly identical, which creates repetitive and generic interpretations. Each suit should have distinct meanings that reflect their elemental associations.
| "normal": "物质世界的新机会,财富的开始,事业的种子。", | |
| "reverse": "错失的财务机会,物质欲望,贪婪。" | |
| "normal": "现实世界中的新机遇,财富或资源的获得,实际计划的启动,物质层面的成长。", | |
| "reverse": "错失金钱或资源的机会,投资失败,过度关注物质导致的空虚。" | 
| "name-en": "侍者 of Pentacles", | ||
| "sign": "土", | ||
| "meaning": { | ||
| "normal": "侍者的积极特质,土元素的正面表达。", | 
    
      
    
      Copilot
AI
    
    
    
      Aug 11, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The court cards (侍者, 骑士, 王后, 国王) have extremely generic meanings that don't provide meaningful guidance. These should have specific interpretations related to their roles and the suit's element.
| if 'sign' in card: | ||
| content += f"对应元素/星座:{card['sign']}" | 
    
      
    
      Copilot
AI
    
    
    
      Aug 11, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code assumes cards may have a 'sign' field, but looking at the JSON data, all cards should have this field. This condition suggests inconsistent data structure, and the lookup might fail for cards without this field.
| if 'sign' in card: | |
| content += f"对应元素/星座:{card['sign']}" | |
| content += f"对应元素/星座:{card['sign']}" | 
| for kind in ["major", "pentacles", "wands", "cups", "swords"]: | ||
| for card in data[kind]: | ||
| if name in card["name"] or name in card["name-en"]: | 
    
      
    
      Copilot
AI
    
    
    
      Aug 11, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The card lookup uses substring matching which could return unexpected results. For example, searching for '1' would match multiple cards like '星币1', '权杖1', etc. This should use exact matching or more precise fuzzy matching.
| for kind in ["major", "pentacles", "wands", "cups", "swords"]: | |
| for card in data[kind]: | |
| if name in card["name"] or name in card["name-en"]: | |
| name_normalized = name.strip().lower() | |
| for kind in ["major", "pentacles", "wands", "cups", "swords"]: | |
| for card in data[kind]: | |
| if (name_normalized == card["name"].strip().lower() or | |
| name_normalized == card["name-en"].strip().lower()): | 
| nullable=False, | ||
| info={"check": ["daily_fortune", "three_card", "celtic_cross"]} | ||
| ) | 
    
      
    
      Copilot
AI
    
    
    
      Aug 11, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check constraint syntax is incorrect for SQLAlchemy. The info parameter doesn't create database constraints. Use CheckConstraint from sqlalchemy to properly validate divination_type values.
| nullable=False, | |
| info={"check": ["daily_fortune", "three_card", "celtic_cross"]} | |
| ) | |
| nullable=False | |
| ) | |
| __table_args__ = ( | |
| CheckConstraint( | |
| "divination_type IN ('daily_fortune', 'three_card', 'celtic_cross')", | |
| name="ck_tarotrecord_divination_type" | |
| ), | |
| ) | 
🔮 功能概述
实现了完整的塔罗牌占卜系统,从原来的26张牌扩展到标准的78张牌库,新增多种占卜方式和智能时间限制。
✨ 主要特性
📚 完整牌库 (26 → 78张)
🎯 新增占卜类型
-每日运势) - 仅使用大阿卡那,每日限1次-三张牌阵) - 过去/现在/未来,使用全牌,每小时限1次-凯尔特十字) - 10张牌完整生活指导,每日限1次/塔罗牌 [牌名]) - 查询特定牌的详细含义/塔罗知识) - 塔罗牌基础知识和使用指南⏰ 智能时间限制
🎉 节日特效
自动检测特殊节日并添加相应解读:
🃏 凯尔特十字可视化
🔧 技术实现
数据库设计
新增
TarotRecord表跟踪用户占卜记录:卡牌选择逻辑
向后兼容
-塔罗牌命令保持完全兼容📝 使用示例
🧪 测试覆盖
Fixes #97.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.