ForcePilot/backend/package/yuxi/channel/extensions/kakaotalk/quick_reply.py

21 lines
635 B
Python
Raw Normal View History

from __future__ import annotations
from yuxi.channel.extensions.kakaotalk.types import KakaoQuickReply
class QuickReplyBuilder:
@staticmethod
def quick_reply(label: str, message_text: str = "", action: str = "message") -> dict:
qr = {"label": label, "action": action}
if message_text:
qr["messageText"] = message_text
return qr
@staticmethod
def web_link(label: str, url: str) -> dict:
return {"label": label, "action": "webLink", "webLinkUrl": url}
@staticmethod
def build(items: list[dict], max_count: int = 10) -> list[dict]:
return items[:max_count]