Skip to content

Commit

Permalink
🚨 auto fix by pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Apr 2, 2024
1 parent 922e8a0 commit b7c4b17
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 66 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ _“许多傻瓜对千奇百怪的迷信说法深信不疑:象牙、护身符
## 安装

1. 安装方式

- 通过 `pip``nb-cli` 安装。pypi无法发行过大安装包,由此安装的插件不包含 `./resource` 下提供的塔罗牌主题资源。仓库提供了两种塔罗牌主题,可在 [v0.4.0 release](https://github.com/MinatoAquaCrews/nonebot_plugin_tarot/releases/tag/v0.4.0) Assets下载,部署至本地后修改 `TAROT_PATH` 配置即可;

- 通过 `zip``git clone` 安装:包含 `resource` 下所有塔罗牌主题资源;
Expand Down Expand Up @@ -89,6 +90,7 @@ _“许多傻瓜对千奇百怪的迷信说法深信不疑:象牙、护身符
TAROT_EXTRA_THEMES=["MyTarotTheme1", "MyTarotTheme2"]
GITHUB_PROXY="https://ghproxy.com/https://raw.githubusercontent.com/" # 或者其他代理
```

```
MyTarotResource
├ MyTarotTheme1
Expand All @@ -98,7 +100,7 @@ _“许多傻瓜对千奇百怪的迷信说法深信不疑:象牙、护身符
```

⚠ 默认使用 `ghproxy.com` 下载仓库内资源,不确保次次成功

👉 [如何添加新的塔罗牌主题资源?](./How-to-add-new-tarot-theme.md) 欢迎贡献!🙏

## 命令
Expand Down
3 changes: 2 additions & 1 deletion nonebot_plugin_tarot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from typing import NoReturn

from nonebot import on_command, on_regex, require
from nonebot.adapters import Event
from nonebot.params import Depends
from nonebot.permission import SUPERUSER
from nonebot.plugin import PluginMetadata, inherit_supported_adapters
from nonebot.params import Depends
from nonebot.rule import Rule

require("nonebot_plugin_localstore") # isort:skip
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_tarot/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import Sequence, Set, Optional
from typing import Optional, Sequence, Set

import httpx
import nonebot
Expand Down
15 changes: 6 additions & 9 deletions nonebot_plugin_tarot/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@
from io import BytesIO
from pathlib import Path
from typing import Dict, List, Tuple, Union

from PIL import Image

try:
import ujson as json # type: ignore
except ModuleNotFoundError:
import json

from .config import download_tarot, ResourceError, tarot_config
from nonebot_plugin_saa import (
AggregatedMessageFactory,
MessageFactory,
PlatformTarget,
TargetQQGroup,
Text,
Image as MessageImage,
)
from nonebot_plugin_saa import AggregatedMessageFactory
from nonebot_plugin_saa import Image as MessageImage
from nonebot_plugin_saa import MessageFactory, PlatformTarget, TargetQQGroup, Text

from .config import ResourceError, download_tarot, tarot_config

CardInfoType = Dict[str, Union[str, Dict[str, str]]]
FormationInfoType = Dict[str, Dict[str, Union[int, bool, List[List[str]]]]]
Expand Down
62 changes: 8 additions & 54 deletions nonebot_plugin_tarot/tarot.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,19 @@
"cards_num": 3,
"is_cut": false,
"representations": [
[
"处境",
"行动",
"结果"
],
[
"现状",
"愿望",
"行动"
]
["处境", "行动", "结果"],
["现状", "愿望", "行动"]
]
},
"时间之流牌阵": {
"cards_num": 3,
"is_cut": true,
"representations": [
[
"过去",
"现在",
"未来",
"问卜者的主观想法"
]
]
"representations": [["过去", "现在", "未来", "问卜者的主观想法"]]
},
"身心灵牌阵": {
"cards_num": 3,
"is_cut": false,
"representations": [
[
"身体状况",
"心里状况",
"精神状态"
]
]
"representations": [["身体状况", "心里状况", "精神状态"]]
},
"四要素牌阵": {
"cards_num": 4,
Expand All @@ -56,36 +35,19 @@
"cards_num": 4,
"is_cut": false,
"representations": [
[
"人际关系现状",
"与对方结识的因缘",
"双方关系的发展",
"双方关系的结论"
]
["人际关系现状", "与对方结识的因缘", "双方关系的发展", "双方关系的结论"]
]
},
"自我探索牌阵": {
"cards_num": 4,
"is_cut": false,
"representations": [
[
"所处的状态",
"外在表现",
"内在想法",
"潜意识"
]
]
"representations": [["所处的状态", "外在表现", "内在想法", "潜意识"]]
},
"恋人金字塔": {
"cards_num": 4,
"is_cut": false,
"representations": [
[
"你的期望",
"恋人的期望",
"目前彼此的关系",
"未来彼此的关系"
]
["你的期望", "恋人的期望", "目前彼此的关系", "未来彼此的关系"]
]
},
"五牌阵": {
Expand Down Expand Up @@ -159,15 +121,7 @@
"cards_num": 7,
"is_cut": true,
"representations": [
[
"过去",
"现在",
"未来",
"对策",
"环境",
"态度",
"预测结果"
]
["过去", "现在", "未来", "对策", "环境", "态度", "预测结果"]
]
}
},
Expand Down

0 comments on commit b7c4b17

Please sign in to comment.