Skip to content

Commit

Permalink
Merge pull request #397 from Ljzd-PRO/dev
Browse files Browse the repository at this point in the history
更新至 v2.10.0
  • Loading branch information
Ljzd-PRO authored Feb 9, 2025
2 parents e403abe + 3cd9260 commit 73bc15c
Show file tree
Hide file tree
Showing 9 changed files with 301 additions and 160 deletions.
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
## Changelog

### 更新内容

[//]: # (#### 💡 新特性)

#### 🐛 修复
- 修复为全部用户执行游戏签到和米游社任务的 **`/签到 *`****`/任务 *`** 命令 (#364) (#384, @dontdot)

- 修复为全部用户执行米游社任务的 **`/任务 *`** 命令 (#390)
- `TypeError: object NoneType can't be used in 'await' expression`
- 修复为全部用户执行米游社任务和游戏签到的 **`/任务 *`** **`/签到 *`** 命令**开始执行提示**被包含在合并转发的问题 (#366)

#### 🔧 杂项
-**移除微博签到**相关功能 (#383, @dontdot)
- [Wiki 文档](https://github.com/Ljzd-PRO/nonebot-plugin-mystool/wiki) 已更新

- 偏好设置中 `global_geetest` 默认值改为 `False` (#373)

### 更新方式

Expand All @@ -31,4 +32,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.8.1…v2.9.0
**Full Changelog**: https://github.com/Ljzd-PRO/nonebot-plugin-mystool/compare/v2.9.0…v2.10.0
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
ljzd@office.ljzd-pro.asia.
[me@ljzd.link](mailto:me@ljzd.link).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
416 changes: 279 additions & 137 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tool.poetry]
name = "nonebot-plugin-mystool"
version = "v2.9.0"
version = "v2.10.0"
description = "QQ聊天、频道机器人插件 | 米游社工具-每日米游币任务、游戏签到、商品兑换、免抓包登录、原神崩铁便笺提醒"
license = "MIT"
authors = [
"Ljzd-PRO <ljzd@office.ljzd-pro.asia>",
"Ljzd-PRO <me@ljzd.link>",
"Everything0519 <598139245@qq.com>"
]
readme = "README.md"
Expand All @@ -24,7 +24,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
httpx = ">=0.24.1,<0.28.0"
httpx = ">=0.24.1,<0.29.0"
nonebot_plugin_apscheduler = ">=0.2.0"
nonebot-plugin-send-anything-anywhere = ">=0.5,<0.8"
ntplib = "^0.4.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.9.0"
__version__ = "v2.10.0"
1 change: 0 additions & 1 deletion src/nonebot_plugin_mystool/command/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ async def handle_first_receive(event: Union[GeneralMessageEvent]):
msg_img = QQGuildMessageSegment.file_image(image_bytes)
else:
await get_cookie.finish("⚠️发送二维码失败,无法登录")
return
try:
await get_cookie.send(msg_img)
except (ActionFailed, AuditException) as e:
Expand Down
14 changes: 7 additions & 7 deletions src/nonebot_plugin_mystool/command/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def _(event: Union[GeneralMessageEvent], matcher: Matcher, command_arg=Com
if specified_user_id == "*":
await manually_game_sign.send("⏳开始为所有用户执行游戏签到...")
for user_id_, user_ in get_unique_users():
msgs_list.append(f"⏳开始为用户 {user_id_} 执行游戏签到...")
await manually_game_sign.send(f"⏳开始为用户 {user_id_} 执行游戏签到...")
await perform_game_sign(
bot=bot,
user=user_,
Expand All @@ -74,7 +74,7 @@ async def _(event: Union[GeneralMessageEvent], matcher: Matcher, command_arg=Com
specified_user = PluginDataManager.plugin_data.users.get(specified_user_id)
if not specified_user:
await manually_game_sign.finish(f"⚠️未找到用户 {specified_user_id}", at_sender=True)
msgs_list.append(f"⏳开始为用户 {specified_user_id} 执行游戏签到...")
await manually_game_sign.send(f"⏳开始为用户 {specified_user_id} 执行游戏签到...")
await perform_game_sign(
bot=bot,
user=specified_user,
Expand All @@ -84,7 +84,7 @@ async def _(event: Union[GeneralMessageEvent], matcher: Matcher, command_arg=Com
msgs_list=msgs_list
)
else:
msgs_list.append("⏳开始游戏签到...")
await manually_game_sign.send("⏳开始游戏签到...")
await perform_game_sign(bot=bot, user=user, user_ids=[user_id], matcher=matcher, event=event,
msgs_list=msgs_list)

Expand Down Expand Up @@ -117,9 +117,9 @@ async def _(event: Union[GeneralMessageEvent], matcher: Matcher, command_arg=Com
await manually_bbs_sign.finish("⚠️你暂无权限执行此操作,只有管理员名单中的用户可以执行此操作")
else:
if specified_user_id == "*":
msgs_list.append("⏳开始为所有用户执行米游币任务...")
await manually_bbs_sign.send("⏳开始为所有用户执行米游币任务...")
for user_id_, user_ in get_unique_users():
await msgs_list.append(f"⏳开始为用户 {user_id_} 执行米游币任务...")
await manually_bbs_sign.send(f"⏳开始为用户 {user_id_} 执行米游币任务...")
await perform_bbs_sign(
bot=bot,
user=user_,
Expand All @@ -132,7 +132,7 @@ async def _(event: Union[GeneralMessageEvent], matcher: Matcher, command_arg=Com
specified_user = PluginDataManager.plugin_data.users.get(specified_user_id)
if not specified_user:
await manually_bbs_sign.finish(f"⚠️未找到用户 {specified_user_id}")
msgs_list.append(f"⏳开始为用户 {specified_user_id} 执行米游币任务...")
await manually_bbs_sign.send(f"⏳开始为用户 {specified_user_id} 执行米游币任务...")
await perform_bbs_sign(
bot=bot,
user=specified_user,
Expand All @@ -142,7 +142,7 @@ async def _(event: Union[GeneralMessageEvent], matcher: Matcher, command_arg=Com
msgs_list=msgs_list
)
else:
msgs_list.append("⏳开始执行米游币任务...")
await manually_bbs_sign.send("⏳开始执行米游币任务...")
await perform_bbs_sign(bot=bot, user=user, user_ids=[user_id], matcher=matcher, event=event,
msgs_list=msgs_list)

Expand Down
4 changes: 2 additions & 2 deletions src/nonebot_plugin_mystool/model/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class Preference(BaseModel):
'''每日自动签到和米游社任务的定时任务执行时间,格式为HH:MM'''
resin_interval: int = 60
'''每次检查原神便笺间隔,单位为分钟'''
global_geetest: bool = True
'''是否开启使用全局极验Geetest,默认开启'''
global_geetest: bool = False
'''是否使用插件配置的全局打码接口,而不是用户个人配置的打码接口,默认关闭'''
geetest_url: Optional[str]
'''极验Geetest人机验证打码接口URL'''
geetest_params: Optional[Dict[str, Any]] = None
Expand Down
3 changes: 1 addition & 2 deletions src/nonebot_plugin_mystool/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,13 @@ def generate_ds(data: Union[str, dict, list, None] = None, params: Union[str, di
return f"{t},{r},{c}"


async def get_validate(user: UserData, gt: str = None, challenge: str = None, retry: bool = True):
async def get_validate(user: UserData, gt: str = None, challenge: str = None):
"""
使用打码平台获取人机验证validate
:param user: 用户数据对象
:param gt: 验证码gt
:param challenge: challenge
:param retry: 是否允许重试
:return: 如果配置了平台URL,且 gt, challenge 不为空,返回 GeetestResult
"""
if not plugin_config.preference.global_geetest:
Expand Down

0 comments on commit 73bc15c

Please sign in to comment.