新增 Zalo OA、Zoom Chat、Zulip 三个渠道扩展。 Zalo OA 渠道扩展主要模块:sidecar_client, config, gateway, outbound, streaming, pairing, security, auth, dedupe, directory, monitor, status, session, reactions, tools Zoom Chat 渠道扩展主要模块:config, gateway, webhook, outbound, streaming, pairing, security, crypto, dedupe, actions, media, mentions, monitor, status, session, reactions, threading Zulip 渠道扩展主要模块:client, config, gateway, outbound, streaming, pairing, security, monitor, status
22 lines
557 B
Python
22 lines
557 B
Python
import re
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class ZoomMentions:
|
|
def extract_mentions(self, raw_message: dict) -> list[str]:
|
|
inner = raw_message.get("payload", {}).get("object", {})
|
|
chat_type = inner.get("chat_type", "group")
|
|
sender = inner.get("sender", "")
|
|
content = inner.get("message", "")
|
|
|
|
if chat_type == "1on1":
|
|
return [sender]
|
|
|
|
mentions = []
|
|
matches = re.findall(r"@([\w.@-]+)", content)
|
|
mentions.extend(matches)
|
|
|
|
return list(set(mentions))
|