mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-06-15 07:14:08 +00:00
Fix deadlock: get_group_member_info blocks receive loop
This commit is contained in:
parent
b1a3053ceb
commit
0c3063b78c
@ -198,9 +198,9 @@ class NapcatChannel(BaseChannel):
|
||||
|
||||
post_type = payload.get("post_type")
|
||||
if post_type == "message":
|
||||
await self._on_message(payload)
|
||||
asyncio.create_task(self._on_message(payload))
|
||||
elif post_type == "notice":
|
||||
await self._on_notice(payload)
|
||||
asyncio.create_task(self._on_notice(payload)) # avoid deadlock
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Inbound: messages
|
||||
@ -390,6 +390,7 @@ class NapcatChannel(BaseChannel):
|
||||
{"group_id": group_id, "user_id": user_id, "no_cache": True},
|
||||
)
|
||||
data = resp.get("data", {})
|
||||
# logger.debug("get_group_member_info: {}", resp)
|
||||
return data.get("card") or data.get("nickname") or str(user_id)
|
||||
except Exception as e:
|
||||
logger.warning("napcat: get_group_member_info failed: {}", e)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user