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

[BUG]获取群荣誉信息API超时 #80

Open
zangxx66 opened this issue Aug 29, 2020 · 2 comments
Open

[BUG]获取群荣誉信息API超时 #80

zangxx66 opened this issue Aug 29, 2020 · 2 comments
Labels
question Further information is requested

Comments

@zangxx66
Copy link

调用get_group_honor_info方法试图获取当前龙王,等待很久然后报错API超时


[2020-08-29 20:38:38,831 chat] ERROR: <class 'aiocqhttp.exceptions.NetworkError'> occured when who_is_longwang handling message 10617.
[2020-08-29 20:38:38,831 chat] ERROR: WebSocket API call timeout
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/aiocqhttp/api_impl.py", line 118, in fetch
    return await asyncio.wait_for(future, timeout_sec)
  File "/usr/lib/python3.8/asyncio/tasks.py", line 490, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

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 25, in who_is_longwang
    data = await bot.get_group_honor_info(group_id=gid, type='talkative')
  File "/usr/local/lib/python3.8/dist-packages/aiocqhttp/__init__.py", line 223, in call_action
    return await self._api.call_action(action=action, **params)
  File "/usr/local/lib/python3.8/dist-packages/aiocqhttp/api_impl.py", line 186, in call_action
    result = await self._wsr_api.call_action(action, **params)
  File "/usr/local/lib/python3.8/dist-packages/aiocqhttp/api_impl.py", line 162, in call_action
    await ResultStore.fetch(seq, self._timeout_sec))
  File "/usr/local/lib/python3.8/dist-packages/aiocqhttp/api_impl.py", line 122, in fetch
    raise NetworkError('WebSocket API call timeout')
aiocqhttp.exceptions.NetworkError: WebSocket API call timeout


复现

`
@sv.on_fullmatch('谁是龙王')

async def who_is_longwang(bot, ev):
gid = ev.group_id
data = await bot.get_group_honor_info(group_id=gid, type='talkative')
talkative = data.current_talkative
sv.logger.info(f'[longwang INFO]:{talkative}')
at = MessageSegment.at(talkative.user_id)
msg = f'{at}是龙王,持续天数{talkative.day_count}天'
await bot.send(ev, msg)`

1.使用以上代码试图获取群荣誉信息
2.等待1分钟后控制台报错WebSocket API call timeout

版本

cqhttp-mirai- 0.2.3-embedded-all.jar

mirai-core-

mirai-console-

@yyuueexxiinngg
Copy link
Owner

请问是否有cqhttp-mirai的log

@yyuueexxiinngg yyuueexxiinngg added the question Further information is requested label Aug 30, 2020
@zangxx66
Copy link
Author

请问是否有cqhttp-mirai的log

17:53:14 [INFO] [BOT 735742327] [母猪连结(719892154)] PicACG(444742616) -> [mirai:source:10659,198149367]谁是龙王
已开启debug,cqhttp-mirai只有这一条,没有任何返回信息也没有任何报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants