Skip to content

Commit

Permalink
Merge pull request #301 from Ljzd-PRO/dev
Browse files Browse the repository at this point in the history
更新至 v2.5.0
  • Loading branch information
Ljzd-PRO committed May 22, 2024
2 parents a2e075f + e11f5c7 commit 282f1cf
Show file tree
Hide file tree
Showing 24 changed files with 1,741 additions and 318 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/plugin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- ".github/actions/setup-python/**"
- ".github/workflows/plugin-test.yml"
- "src/nonebot_plugin_mystool/**"
- "tests/**"
- "pyproject.toml"
- "poetry.lock"
pull_request:
Expand All @@ -16,12 +17,17 @@ on:
- ".github/actions/setup-python/**"
- ".github/workflows/plugin-test.yml"
- "src/nonebot_plugin_mystool/**"
- "tests/**"
- "pyproject.toml"
- "poetry.lock"

jobs:
plugin_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
name: nonebot2 plugin test
permissions:
issues: read
Expand All @@ -34,8 +40,7 @@ jobs:
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: "3.11"

python-version: ${{ matrix.python-version }}
- name: Test Plugin
id: plugin-test
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: "3.11"
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Changelog

### 更新内容

#### 💡 新特性
- 新增日志提示推送超话兑换码信息 - by @Joseandluue
- 适配微博多账号 - by @Joseandluue
- 改进人机验证日志输出 (#299)

#### 🐛 修复
- **修复较新版本的 nonebot2 导入插件失败的问题**
- 补充插件元数据以符合 nonebot 规定
- 微博超话兑换码相关代码优化 - by @Joseandluue
- Windows 下默认不使用多进程生成商品图片 (#282)
- 修复删除兑换计划出错的问题 (#297)

#### 🔧 杂项
- 替换所有 Workflow 文件,新增插件测试,通过 CI 自动检查插件能否导入成功

### 更新方式

如果使用的是镜像源,可能需要等待镜像源同步才能更新至最新版

- 使用 nb-cli 命令:
```
nb plugin update nonebot-plugin-mystool
```

- 或 pip 命令(如果使用了虚拟环境,需要先进入虚拟环境):
```
pip install --upgrade nonebot-plugin-mystool
```

### 兼容性

- `>=v2.0.0``configV2.json`, `dataV2.json`, `.env` 文件,如果存在 V1 版本的文件,**会自动备份和升级**
- `>=v1.0.0, <v2.0.0` 插件配置/数据包含于 `plugin_data.json`
- `< v1.0.0` 插件配置文件为 `pluginConfig.json`

**Full Changelog**: https://github.com/Ljzd-PRO/nonebot-plugin-mystool/compare/v2.4.0…v2.5.0
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

# mysTool - 米游社辅助工具插件

> [!Note]
> 目前本项目基本不再新增功能,问题修复可能也会比较迟,主要是由于当前项目代码可维护性较差(\
> 以及个人时间安排等。未来可能考虑彻底重做一次
## ⚡ 功能和特性

- 支持QQ聊天和QQ频道
Expand Down
1,074 changes: 1,074 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-plugin-mystool"
version = "v2.4.0"
version = "v2.5.0"
description = "QQ聊天、频道机器人插件 | 米游社工具-每日米游币任务、游戏签到、商品兑换、免抓包登录、原神崩铁便笺提醒"
license = "MIT"
authors = [
Expand Down Expand Up @@ -39,11 +39,6 @@ nonebot2 = ">=2.0.0"
pytz = ">=2023.4,<2025.0"

[tool.poetry.group.test.dependencies]
nonebot2 = { version = "^2.0.1", extras = ["fastapi", "httpx", "websockets"] }
nonebug = "^0.3.4"
pytest = "^7.4.0"
pytest-html = ">=3.2,<5.0"
pytest-asyncio = ">=0.21,<0.24"
flake8 = ">=6.1,<8.0"

[tool.poetry.group.test]
Expand Down
55 changes: 32 additions & 23 deletions src/nonebot_plugin_mystool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
import nonebot
from nonebot import require
from nonebot.plugin import PluginMetadata

require("nonebot_plugin_saa")
require("nonebot_plugin_apscheduler")

_driver = nonebot.get_driver()
_command_begin = list(_driver.config.command_start)[0]

from . import _version

__version__ = _version.__version__
__plugin_meta__ = PluginMetadata(
name=f"❖米游社小助手插件\n版本 - {__version__}\n",
name="米游社小助手插件\n",
description="米游社工具-每日米游币任务、游戏签到、商品兑换、免抓包登录\n",
type="application",
homepage="https://github.com/Ljzd-PRO/nonebot-plugin-mystool",
supported_adapters={"~onebot.v11", "~qq"},
usage=
"\n🔐 {HEAD}登录 ➢ 登录绑定米游社账户"
"\n📦 {HEAD}地址 ➢ 设置收货地址ID"
"\n🗓️ {HEAD}签到 ➢ 手动进行游戏签到"
"\n📅 {HEAD}任务 ➢ 手动执行米游币任务"
"\n🛒 {HEAD}兑换 ➢ 米游币商品兑换相关"
"\n🎁 {HEAD}商品 ➢ 查看米游币商品信息(商品ID)"
"\n📊 {HEAD}原神便笺 ➢ 查看原神实时便笺(原神树脂、洞天财瓮等)"
"\n📊 {HEAD}铁道便笺 ➢ 查看星穹铁道实时便笺(开拓力、每日实训等)"
"\n👁️‍🗨️ {HEAD}wb兑换 ➢ 查看微博本期超话签到的兑换码(暂支持原神和星穹铁道)"
"\n⚙️ {HEAD}设置 ➢ 设置是否开启通知、每日任务等相关选项"
"\n🔑 {HEAD}账号设置 ➢ 设置设备平台、是否开启每日计划任务、频道任务"
"\n🔔 {HEAD}通知设置 ➢ 设置是否开启每日米游币任务、游戏签到的结果通知"
"\n🖨️ {HEAD}导出Cookies ➢ 导出绑定的米游社账号的Cookies数据"
"\n🖇️ {HEAD}用户绑定 ➢ 绑定关联其他聊天平台或其他账号的用户数据"
"\n📨 {HEAD}私信响应 ➢ 让机器人发送一条私信给你,主要用于QQ频道"
"\n📖 {HEAD}帮助 ➢ 查看帮助信息"
"\n🔍 {HEAD}帮助 <功能名> ➢ 查看目标功能详细说明"
f"\n🔐 {_command_begin}登录 ➢ 登录绑定米游社账户"
f"\n📦 {_command_begin}地址 ➢ 设置收货地址ID"
f"\n🗓️ {_command_begin}签到 ➢ 手动进行游戏签到"
f"\n📅 {_command_begin}任务 ➢ 手动执行米游币任务"
f"\n🛒 {_command_begin}兑换 ➢ 米游币商品兑换相关"
f"\n🎁 {_command_begin}商品 ➢ 查看米游币商品信息(商品ID)"
f"\n📊 {_command_begin}原神便笺 ➢ 查看原神实时便笺(原神树脂、洞天财瓮等)"
f"\n📊 {_command_begin}铁道便笺 ➢ 查看星穹铁道实时便笺(开拓力、每日实训等)"
f"\n👁️‍🗨️ {_command_begin}wb签到 ➢ 手动进行微博超话签到(每日定时:游戏签到后1h)"
f"\n👁️‍🗨️ {_command_begin}wb兑换 ➢ 查看微博本期超话签到的兑换码(暂支持原神和星穹铁道)"
f"\n⚙️ {_command_begin}设置 ➢ 设置是否开启通知、每日任务等相关选项"
f"\n🔑 {_command_begin}账号设置 ➢ 设置设备平台、是否开启每日计划任务、频道任务"
f"\n🔔 {_command_begin}通知设置 ➢ 设置是否开启每日米游币任务、游戏签到的结果通知"
f"\n🖨️ {_command_begin}导出Cookies ➢ 导出绑定的米游社账号的Cookies数据"
f"\n🖇️ {_command_begin}用户绑定 ➢ 绑定关联其他聊天平台或其他账号的用户数据"
f"\n📨 {_command_begin}私信响应 ➢ 让机器人发送一条私信给你,主要用于QQ频道"
f"\n📖 {_command_begin}帮助 ➢ 查看帮助信息"
f"\n🔍 {_command_begin}帮助 <功能名> ➢ 查看目标功能详细说明"
"\n\n⚠️你的数据将经过机器人服务器,请确定你信任服务器所有者再使用。",
extra={"version": __version__}
)
Expand All @@ -34,14 +46,11 @@

upgrade_plugin_data()

# 在此处使用 get_driver() 防止多进程生成图片时反复调用
# 防止多进程生成图片时反复调用

from .utils import CommandBegin
from nonebot import init
from nonebot import get_driver

init() # 初始化Driver对象
get_driver().on_startup(CommandBegin.set_command_begin)
_driver.on_startup(CommandBegin.set_command_begin)

# 加载命令

Expand Down
2 changes: 1 addition & 1 deletion src/nonebot_plugin_mystool/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "v2.4.0"
__version__ = "v2.5.0"
1 change: 1 addition & 0 deletions src/nonebot_plugin_mystool/api/myb_missions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async def sign(self, user: UserData, retry: bool = True) -> Tuple[MissionStatus,
"""
签到
:param user: 用户数据对象
:param retry: 是否允许重试
:return: (BaseApiStatus, 签到获得的米游币数量)
"""
Expand Down
Loading

0 comments on commit 282f1cf

Please sign in to comment.