Skip to content

Commit

Permalink
📝 chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KafCoppelia committed Jul 15, 2023
1 parent 3d90e7f commit 0268536
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 51 deletions.
34 changes: 8 additions & 26 deletions How-to-add-new-theme.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,28 @@
## 如何在`v0.4.2` 或更早版本上更新抽签主题资源
## 如何添加更多的抽签主题资源

`v0.4.3` 新增东方归言录(touhou_lostword)全新抽签主题资源!
1. 将新的主题目录放置在 `./img` 下;

1. 将新资源文件夹放置在`./img`下;

2. 修改`config.py``ThemesFlagConfig`,添加`touhou_lostword_flag` 标志,例如:
2. 修改 `config.py` 中的 `ThemesFlagConfig`,添加 `new_theme_flag` 标志,例如:

```python
...
touhou_flag: bool = True
touhou_lostword_flag: bool = True
touhou_olg_flag: bool = True
new_theme_flag: bool = True
...
```

之后可在`.env`下设置以启用或关闭该主题:
之后可在 `.env` 下设置以启用或关闭该主题:

```python
TOUHOU_LOSTWORD_FLAG=true
```

3. 修改`utils.py``FortuneThemesDict`,添加键值对:


```python
...
"touhou": ["东方", "touhou", "Touhou", "车万"],
"touhou_old":
["旧东方", "旧版东方", "老东方", "老版东方", "经典东方"],
...
NEW_THEME_FLAG=true
```

3. 修改 `utils.py` 中的 `FortuneThemesDict`,添加键值对:

```python
...
"touhou": ["东方", "touhou", "Touhou", "车万"],
"touhou_lostword":
["东方归言录", "东方lostword", "touhou lostword", "Touhou dlc"],
"touhou_old":
["旧东方", "旧版东方", "老东方", "老版东方", "经典东方"],
"new_theme":["新主题", "新的主题"],
...
```

Expand Down
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ _🙏 今日运势 🙏_
</a>

<a href="https://github.com/nonebot/nonebot2">
<img src="https://img.shields.io/badge/nonebot2-2.0.0rc4+-green">
<img src="https://img.shields.io/badge/nonebot2-^2.0.0rc4-green">
</a>

<a href="https://github.com/MinatoAquaCrews/nonebot_plugin_fortune/releases/tag/v0.4.11.post1">
<a href="https://github.com/MinatoAquaCrews/nonebot_plugin_fortune/releases/tag/v0.4.12a1">
<img src="https://img.shields.io/github/v/release/MinatoAquaCrews/nonebot_plugin_fortune?color=orange">
</a>

Expand All @@ -35,53 +35,53 @@ _🙏 今日运势 🙏_

## 版本

[v0.4.11.post1](https://github.com/MinatoAquaCrews/nonebot_plugin_fortune/releases/tag/v0.4.11.post1)
[v0.4.12a1](https://github.com/MinatoAquaCrews/nonebot_plugin_fortune/releases/tag/v0.4.12a1)

⚠️ 适配nonebot2-2.0.0rc4+
⚠️ 适配nonebot2 `^2.0.0rc4`

👉 [如何添加自己的抽签主题资源?欢迎贡献!🙏](https://github.com/MinatoAquaCrews/nonebot_plugin_fortune/blob/master/How-to-add-new-theme.md)
👉 [如何添加更多的抽签主题资源?欢迎贡献!🙏](https://github.com/MinatoAquaCrews/nonebot_plugin_fortune/blob/master/How-to-add-new-theme.md)

## 安装

1. 安装方式:

- 通过 `pip``nb`;pypi无法发行过大安装包,由此安装的插件不包含 `resource/img`**所有抽签主题图片**,需单独下载。建议 `zip` 包下载后提取 `resource` 下所有资源至本地,后更改 `FORTUNE_PATH` 配置即可;
- 通过 `pip``nb` 安装:由于pypi无法发行过大安装包,由此安装的插件不包含 `resource/img`**所有抽签主题图片**。所有抽签主题图片资源在 [`v0.4.10 release`](https://github.com/MinatoAquaCrews/nonebot_plugin_fortune/releases/tag/v0.4.10) Assets提供,下载至本地后,更改 `FORTUNE_PATH` 配置即可;

- 通过 `zip``git clone` 安装:包含 `resource` 下所有插件资源;

2. 抽签主题图片 `img` 、字体 `font` 、文案 `fortune` 等资源均位于 `./resource` 下,可在 `env` 中设置 `FORTUNE_PATH`

```python
```shell
FORTUNE_PATH="your-path-to-resource" # For example, "./my-data/fortune",其下有img、font、fortune文件夹等资源
```

⚠️️ 插件启动时,将自动检查资源是否缺失(**除字体与图片**资源)

3.`env` 下设置 `xxx_FLAG` 以启用或关闭抽签随机主题(默认全部开启),例如:

```python
```shell
AMAZING_GRACE_FLAG=false # 奇异恩典·圣夜的小镇
ARKNIGHTS_FLAG=true # 明日方舟
ASOUL_FLAG=true # A-SOUL
WSGR_FLAG=true # 战舰少女R
AZURE_FLAG=true # 碧蓝航线
DC4_FLAG=false # dc4
EINSTEIN_FLAG=true # 爱因斯坦携爱敬上
GENSHIN_FLAG=true # 原神
GRANBLUE_FANTASY_FLAG=true # 碧蓝幻想
HOLOLIVE_FLAG=true # Hololive
HOSHIZORA_FLAG=true # 星空列车与白的旅行
LIQINGGE_FLAG=true # 李清歌
ONMYOJI_FLAG=false # 阴阳师
PCR_FLAG=true # 公主连结
TOUHOU_FLAG=true # 东方
TOUHOU_LOSTWORD_FLAG=true # 东方归言录
TOUHOU_OLD_FLAG=false # 东方旧版
HOLOLIVE_FLAG=true # Hololive
PUNISHING_FLAG=true # 战双帕弥什
GRANBLUE_FANTASY_FLAG=true # 碧蓝幻想
PRETTY_DERBY_FLAG=true # 赛马娘
DC4_FLAG=false # dc4
EINSTEIN_FLAG=true # 爱因斯坦携爱敬上
SWEET_ILLUSION_FLAG=true # 灵感满溢的甜蜜创想
LIQINGGE_FLAG=true # 李清歌
HOSHIZORA_FLAG=true # 星空列车与白的旅行
PUNISHING_FLAG=true # 战双帕弥什
SAKURA_FLAG=true # 樱色之云绯色之恋
SUMMER_POCKETS_FLAG=false # 夏日口袋
AMAZING_GRACE_FLAG=false # 奇异恩典·圣夜的小镇
SWEET_ILLUSION_FLAG=true # 灵感满溢的甜蜜创想
TOUHOU_FLAG=true # 东方
TOUHOU_LOSTWORD_FLAG=true # 东方归言录
TOUHOU_OLD_FLAG=false # 东方旧版
WARSHIP_GIRLS_R_FLAG=true # 战舰少女R
```

**请确保不全为 `false`,否则会抛出错误**
Expand Down Expand Up @@ -132,7 +132,7 @@ _🙏 今日运势 🙏_
- [ ] 文案排版算法;
- [ ] 新增功能:每日星座运势;
- [x] 新增功能:资源缺失检查、自动下载;
- [ ] 新增资源:新的抽签主题资源!
- [x] 新增资源:新的抽签主题资源!

## 命令

Expand Down Expand Up @@ -176,4 +176,6 @@ _🙏 今日运势 🙏_

4. [FloatTech-zbpdata/Fortune](https://github.com/FloatTech/zbpdata):其余主题签;

5. 运势文案:[KafCoppelia](https://github.com/KafCoppelia)`copywriting.json` 整合了関係運、全体運、勉強運、金運、仕事運、恋愛運、総合運、大吉、中吉、小吉、吉、半吉、末吉、末小吉、凶、小凶、半凶、末凶、大凶及700+条运势文案!来源于Hololive早安系列2019年第6.10~9.22期,有修改。
5. 战舰少女R(Warship Girls R):[veadex](https://github.com/veadex)

6. 运势文案:[KafCoppelia](https://github.com/KafCoppelia)`copywriting.json` 整合了関係運、全体運、勉強運、金運、仕事運、恋愛運、総合運、大吉、中吉、小吉、吉、半吉、末吉、末小吉、凶、小凶、半凶、末凶、大凶及700+条运势文案!来源于Hololive早安系列2019年第6.10~9.22期,有修改。
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot_plugin_fortune"
version = "0.4.11.post1"
version = "0.4.12a1"
description = "Fortune divination!"
authors = ["KafCoppelia <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -32,4 +32,4 @@ priority = "primary"

[[tool.poetry.source]]
name = "PyPI"
priority = "explicit"
priority = "explicit"

0 comments on commit 0268536

Please sign in to comment.