实现完整的Freshdesk和Freshchat集成支持,包含会话守卫、错误定义、消息去重、配置管理、webhook处理、出站消息发送、状态监控、安全校验、配对功能和流式回复支持
14 lines
513 B
Python
14 lines
513 B
Python
class FreshdeskSessionGuard:
|
|
|
|
@staticmethod
|
|
def should_respond_freshchat(status: str, account) -> tuple[bool, str]:
|
|
if status == "resolved" and account.auto_skip_resolved:
|
|
return False, "conversation_resolved"
|
|
return True, "ok"
|
|
|
|
@staticmethod
|
|
def should_respond_freshdesk(ticket_status: int, account) -> tuple[bool, str]:
|
|
if ticket_status in (4, 5) and account.auto_skip_resolved:
|
|
return False, "ticket_resolved_or_closed"
|
|
return True, "ok"
|