diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..94efbad0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,29 @@ +## 该 PR 相关 Issue / Involved issue + +Close # + +## 描述 / Description + +``` + +``` + +## 更改检查表 / Change Checklist + +- [ ] 有插件命令更新 + - [ ] 已更新 bot 帮助文件 +- [ ] 有流程交互 + - [ ] 指引明确 + - [ ] 可以退出 +- [ ] 会触发频率限制 + - [ ] 有对应的限制措施 +- [ ] 需要用户输入数据 + - [ ] 验证用户数据 + - [ ] 如果是文件,检查了文件大小 + - [ ] 对保存的数据再次进行了验证 +- [ ] 添加了新的依赖包 +- [ ] 测试 + - [ ] 本地通过了测试 + - [ ] CI 通过了测试 + +## 说明 / Note diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa906e8e..c630b8d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,12 +32,14 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install poetry + - name: restore or create a python virtualenv + id: cache + uses: syphar/restore-virtualenv@v1.2 + - name: Create venv + if: steps.cache.outputs.cache-hit != 'true' run: | pip install --upgrade poetry poetry config virtualenvs.create false - - name: Install dependencies - run: | poetry install poetry install --extras test - name: Test with pytest diff --git a/plugins/system/get_chat.py b/plugins/system/get_chat.py index 0bffbd47..ecd9497f 100644 --- a/plugins/system/get_chat.py +++ b/plugins/system/get_chat.py @@ -59,13 +59,17 @@ class GetChat(Plugin): except UserNotFoundError: user_info = None if user_info is not None: - text += "米游社绑定:" if user_info.region == RegionEnum.HYPERION else "HOYOLAB 绑定:" + if user_info.region == RegionEnum.HYPERION: + text += "米游社绑定:" + uid = user_info.yuanshen_uid + else: + text += "原神绑定:" + uid = user_info.genshin_uid temp = "Cookie 绑定" try: await get_genshin_client(chat.id) except CookiesNotFoundError: temp = "UID 绑定" - uid = user_info.genshin_uid or user_info.yuanshen_uid text += f"{temp}\n" \ f"游戏 ID:{uid}" with contextlib.suppress(Exception):