Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加兑换计划后的兑换时间错误 #330

Open
qianxuu opened this issue Jul 5, 2024 · 3 comments · Fixed by #338
Open

添加兑换计划后的兑换时间错误 #330

qianxuu opened this issue Jul 5, 2024 · 3 comments · Fixed by #338
Labels
bug Something isn't working

Comments

@qianxuu
Copy link

qianxuu commented Jul 5, 2024

如下图,mt商品命令显示的兑换时间为 8 号,添加后提示下次兑换时间为 15 号,mt兑换命令查询的又是 8 号
实际查看配置文件的 next_time 时间戳也是 15 号

ebb65e23fba730c8f089e570178bdfb7

QQ_1720162083583

@Ljzd-PRO Ljzd-PRO added the bug Something isn't working label Jul 7, 2024
@Ljzd-PRO Ljzd-PRO moved this from Todo to Wait To Complete in nonebot-plugin-mystool Project Jul 11, 2024
@Ljzd-PRO Ljzd-PRO linked a pull request Jul 11, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from Wait To Complete to Done in nonebot-plugin-mystool Project Jul 11, 2024
@Ljzd-PRO
Copy link
Owner

下次兑换时间不一定是 next_time,也可能是商品详情的 sale_start_time

@Ljzd-PRO Ljzd-PRO reopened this Jul 15, 2024
@Ljzd-PRO Ljzd-PRO moved this from Done to In Progress in nonebot-plugin-mystool Project Jul 15, 2024
@qianxuu
Copy link
Author

qianxuu commented Jul 15, 2024

下次兑换时间不一定是 next_time,也可能是商品详情的 sale_start_time

我降级到 2.5.0 后测试,添加兑换计划后 sale_start_timenull,经过反复尝试,发现使用 mt兑换.+ 命令添加兑换计划后重启 bot,再使用 mt兑换.- 命令,并不会删除兑换计划,而是刷新了兑换计划中的商品信息,如 sale_start_time 会出现,此时继续使用 mt兑换.- 命令会报错 AttributeError: 'AsyncIOScheduler' object has no attribute 'JobLookupError',重启 bot 后才能正常删除

下面是刚添加计划后的 json

"good": {
  "type": 1,
  "next_time": 1721818800,
  "status": "not_in_sell",
  "sale_start_time": null,
  "time_by_detail": null,
  "next_num": 10,
  "account_exchange_num": 0,
  "account_cycle_limit": 1,
  "account_cycle_type": "forever",
  "game_biz": null,
  "game": null,
  "unlimit": false,
  "name": null,
  "goods_name": "\u3010\u539f\u795e\u3011\u8e66\u8e66\u70b8\u5f39\u9a6c\u514b\u676f",
  "goods_id": "2024070911143",
  "price": 20500,
  "icon": "https://bbs-static.miyoushe.com/static/2024/07/09/409ab9ae1349e4988020e34c2dbccd42_1234057808800182538.JPG"
},

@Do1e
Copy link

Do1e commented Nov 6, 2024

不清楚是ExchangePlan的什么行为触发了这里的plan in user.exchange_plans为False

一个临时的解决方案是在list下进行删除

temp = list(user.exchange_plans)
temp.remove(plan)
user.exchange_plans = set(temp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants