ForcePilot/backend/package/yuxi/channel/extensions/zoomchat/reactions.py
Kris d5e36d33b7 feat(channel): 添加 Zalo OA、Zoom Chat 和 Zulip 渠道扩展
新增 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
2026-05-21 12:06:26 +08:00

56 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import logging
logger = logging.getLogger(__name__)
ZOOM_EMOJI_MAP = {
"👍": "thumbsup",
"👎": "thumbsdown",
"❤️": "heart",
"😂": "joy",
"😮": "open_mouth",
"😢": "cry",
"😡": "angry",
"😆": "laugh",
"😍": "heart_eyes",
"😱": "scream",
"🤔": "thinking",
"😴": "sleeping",
"😎": "sunglasses",
"🤗": "hug",
"🙏": "pray",
"💪": "muscle",
"🎉": "tada",
"🔥": "fire",
"💯": "100",
"": "white_check_mark",
"": "x",
"": "heavy_plus_sign",
"": "heavy_minus_sign",
}
def parse_reaction_event(payload: dict) -> dict | None:
inner = payload.get("payload", {}).get("object", {})
if not inner:
return None
return {
"event_type": payload.get("event", ""),
"message_id": inner.get("message_id", ""),
"reaction_name": inner.get("reaction_name", ""),
"emoji": inner.get("emoji", ""),
"user_email": inner.get("user_email", ""),
"channel_id": payload.get("payload", {}).get("channel_id", ""),
}
def emoji_to_zoom_reaction(emoji: str) -> str | None:
return ZOOM_EMOJI_MAP.get(emoji)
def zoom_reaction_to_emoji(name: str) -> str:
for emoji, rname in ZOOM_EMOJI_MAP.items():
if rname == name:
return emoji
return "👍"