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

/get_group_honor_info不符合onebot标准 #258

Closed
zangxx66 opened this issue Sep 9, 2020 · 2 comments
Closed

/get_group_honor_info不符合onebot标准 #258

zangxx66 opened this issue Sep 9, 2020 · 2 comments
Labels
bug Something isn't working
Projects
Milestone

Comments

@zangxx66
Copy link

zangxx66 commented Sep 9, 2020

环境信息
请根据实际使用环境修改以下信息

go-cqhttp版本: go-cqhttp-v0.9.24-linux-amd64
运行环境: linux-amd64
连接方式: 反向WS

bug内容
请在这里详细描述bug的内容

成功调用接口后获取不到对应的字段

[2020-09-09 19:24:44,964 nonebot] INFO: Self: 735742327, Message 1830922264 from 444742616@[群:719892154]: '迫害龙王'
[2020-09-09 19:24:44,964 chat] INFO: Message 1830922264 triggered who_is_longwang by PrefixTrigger.
[2020-09-09 19:24:45,057 chat] ERROR: <class 'KeyError'> occured when who_is_longwang handling message 1830922264.
[2020-09-09 19:24:45,057 chat] ERROR: 'current_talkative'
Traceback (most recent call last):
  File "/root/HoshinoBot/hoshino/msghandler.py", line 28, in handle_message
    await sf.func(bot, event)
  File "/root/HoshinoBot/hoshino/service.py", line 218, in wrapper
    return await func(bot, event)
  File "/root/HoshinoBot/hoshino/modules/groupmaster/chat.py", line 29, in who_is_longwang
    talkative = data['current_talkative']
KeyError: 'current_talkative'
[2020-09-09 19:24:45,058 nonebot] INFO: Message 1830922264 is ignored

复现方法
请在这里分步骤的描述如何复现这个bug

根据onebot文档,当type为talkative时可查看目标群的当前龙王信息,返回的字段中current_talkative为当前龙王的信息,使用如下代码获取群荣誉信息时会返回KeyError: 'current_talkative'错误

data = await bot.get_group_honor_info(group_id=gid, type='talkative')
talkative = data['current_talkative']```
@Mrs4s
Copy link
Owner

Mrs4s commented Sep 9, 2020

请尝试重启go-cqhttp 这可能是cookie过期导致的

@Mrs4s Mrs4s added the bug Something isn't working label Sep 9, 2020
@Mrs4s Mrs4s added this to the 1.0.0 milestone Sep 9, 2020
@Mrs4s Mrs4s added this to To Do in V1.0.0 Sep 9, 2020
@zangxx66
Copy link
Author

zangxx66 commented Sep 9, 2020

ok,重启后正常了,但是还遇到了一个概率性问题,因为我这个接口返回的message是一个at加上一张图片,偶然性的会报错[2020-09-09 19:43:18] [WARNING]: 警告: 群 719892154 消息图片上传失败: upload failed

Mrs4s added a commit that referenced this issue Oct 2, 2020
@Mrs4s Mrs4s closed this as completed Oct 3, 2020
V1.0.0 automation moved this from To Do to Done Oct 3, 2020
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
V1.0.0
  
Done
Development

No branches or pull requests

2 participants