Skip to content

Commit

Permalink
Merge pull request #362 from Ljzd-PRO/dev
Browse files Browse the repository at this point in the history
更新至 v2.8.0
  • Loading branch information
Ljzd-PRO authored Aug 19, 2024
2 parents 0a02b01 + b978f0b commit b813782
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 81 deletions.
19 changes: 11 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
### 更新内容

#### 💡 新特性
- 支持指定要进行签到的游戏(游戏签到)(#291) - by @Joseandluue
- 通过 `/账号设置` 命令更改游戏签到限定范围
- 米游币任务 — 讨论区签到 的人机验证增加更多的日志输出
- 群聊中使用时构建合并的消息/聊天记录再进行推送 (#353) - by @dontdot
- 实时便笺根据可签到的游戏进行自动推送 (#352) - by @dontdot

#### 🐛 修复
- 修复体力阈值设置需要发送两次的问题 (#342) - by @Joseandluue
- 修复米游币任务讨论区签到在人机验证成功后签到失败的问题 (#323, #309)
- 撤销上个版本兑换时间的相关变更,以修复错误的兑换时间 (#341, #342)
- 修复二维码登录提示已过期的问题 (#357) - by @tym2008
- 修复二维码登录相关的部分反馈文本没有发送的问题 (#357)
- 修复QQ频道私聊不响应的问题 (#356) - by @dontdot
- 修复手动触发米游社任务时,消息列表为空导致任务中断的问题 (#354) - by @dontdot
- 修复截取微博超话id的正则公式错误 (#352) - by @dontdot
- 修复当用户不填写偏好设置 `geetest_params` 时报错的问题 (#352) - by @dontdot

#### 🔧 杂项
- 撤销上个版本 OneBot 协议推送米游币任务结果时不配上图片的变更
[//]: # (#### 🔧 杂项)

### 更新方式

Expand All @@ -34,4 +37,4 @@
- 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.6.0…v2.7.0
**Full Changelog**: https://github.com/Ljzd-PRO/nonebot-plugin-mystool/compare/v2.7.0…v2.8.0
46 changes: 23 additions & 23 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 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.7.0"
version = "v2.8.0"
description = "QQ聊天、频道机器人插件 | 米游社工具-每日米游币任务、游戏签到、商品兑换、免抓包登录、原神崩铁便笺提醒"
license = "MIT"
authors = [
Expand All @@ -26,13 +26,13 @@ packages = [
python = ">=3.9,<4.0"
httpx = ">=0.24.1,<0.28.0"
nonebot_plugin_apscheduler = ">=0.2.0"
nonebot-plugin-send-anything-anywhere = ">=0.5,<0.7"
nonebot-plugin-send-anything-anywhere = ">=0.5,<0.8"
ntplib = "^0.4.0"
Pillow = ">=9.5,<11.0"
requests = "^2.31.0"
nonebot-adapter-onebot = "^2.3.1"
nonebot-adapter-qq = "^1.1.2"
tenacity = "^8.2.3"
tenacity = ">=8.2.3,<10.0.0"
qrcode = "^7.4.2"
pydantic = "^1.10.14"
nonebot2 = ">=2.0.0"
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.7.0"
__version__ = "v2.8.0"
2 changes: 1 addition & 1 deletion src/nonebot_plugin_mystool/api/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ async def verify_verification(

async def fetch_game_token_qrcode(
device_id: str,
app_id: str = "1",
app_id: str,
retry: bool = True
) -> Tuple[BaseApiStatus, Optional[Tuple[str, str]]]:
"""
Expand Down
8 changes: 8 additions & 0 deletions src/nonebot_plugin_mystool/api/myb_missions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,20 @@ async def sign(self, user: UserData, retry: bool = True) -> Tuple[MissionStatus,
logger.debug(f"网络请求返回: {res.text}")
if plugin_config.preference.geetest_url or user.geetest_url:
create_status, mmt_data = await create_verification(self.account)
logger.debug(
"米游币任务 - 讨论区签到: "
f"用户 {self.account.display_name} 创建了人机验证任务,mmt_data: {mmt_data}"
)
if create_status:
if geetest_result := await get_validate(user, mmt_data.gt, mmt_data.challenge):
if await verify_verification(mmt_data, geetest_result, self.account):
logger.success(
f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} 人机验证通过")
continue
logger.debug(
"米游币任务 - 讨论区签到: "
f"用户 {self.account.display_name} 人机验证失败,geetest_result: {geetest_result}"
)
else:
logger.info(
f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} 未配置极验人机验证打码平台")
Expand Down
17 changes: 10 additions & 7 deletions src/nonebot_plugin_mystool/api/weibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,16 @@ async def format_chaohua_data(data: list):
data = [ch for ch in data if ch.get('card_type') == '8']
chaohua_list = []
for onedata in data:
ch_id = re.findall("(?<=containerid=).*?(?=&)", onedata['scheme'])
one_dict = {
'title_sub': onedata['title_sub'],
'id': ch_id[0],
'is_sign': onedata['buttons'][0]['name'] # '已签' / '签到'
}
chaohua_list.append(one_dict)
try:
ch_id = re.findall("(?<=containerid=)[^&]+", onedata['scheme'])
one_dict = {
'title_sub': onedata.get('title_sub', None),
'id': ch_id[0] if ch_id else None,
'is_sign': onedata['buttons'][0]['name'] if onedata.get('buttons') else None # '已签' / '签到'
}
chaohua_list.append(one_dict)
except Exception as e:
logger.error(f"{type(e)}:{e}")
return chaohua_list

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions src/nonebot_plugin_mystool/command/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def handle_first_receive(event: Union[GeneralMessageEvent]):
logger.success(f"用户 {bbs_uid} 成功获取 game_token: {game_token}")
break
elif login_status.qrcode_expired:
get_cookie.finish("⚠️二维码已过期,登录失败")
await get_cookie.finish("⚠️二维码已过期,登录失败")
elif not login_status:
await asyncio.sleep(plugin_config.preference.qrcode_query_interval)
continue
Expand Down Expand Up @@ -153,7 +153,7 @@ async def handle_first_receive(event: Union[GeneralMessageEvent]):
account.cookies.update(cookies)
PluginDataManager.write_plugin_data()
else:
get_cookie.finish("⚠️获取二维码扫描状态超时,请尝试重新登录")
await get_cookie.finish("⚠️获取二维码扫描状态超时,请尝试重新登录")

if not login_status:
notice_text = "⚠️登录失败:"
Expand Down
Loading

0 comments on commit b813782

Please sign in to comment.