mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-06-22 02:34:04 +00:00
fix: feishu bot mention detection — user_id can be None, not just empty string
This commit is contained in:
parent
af4e3b2647
commit
6141b95037
@ -362,8 +362,8 @@ class FeishuChannel(BaseChannel):
|
|||||||
mid = getattr(mention, "id", None)
|
mid = getattr(mention, "id", None)
|
||||||
if not mid:
|
if not mid:
|
||||||
continue
|
continue
|
||||||
# Bot mentions have an empty user_id with a valid open_id
|
# Bot mentions have no user_id (None or "") but a valid open_id
|
||||||
if getattr(mid, "user_id", None) == "" and (getattr(mid, "open_id", None) or "").startswith("ou_"):
|
if not getattr(mid, "user_id", None) and (getattr(mid, "open_id", None) or "").startswith("ou_"):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user