【问题标题】:Viber API documentation problem with conversation_started event对话开始事件的 Viber API 文档问题
【发布时间】:2020-02-06 16:03:53
【问题描述】:

官方 Viber API 文档对此事件并没有真正的帮助,只是强调 send_message 在触发时不应该是端点。有谁知道如何在 PHP 中为聊天机器人欢迎消息编写此事件?我覆盖了整个网络,但一无所获。

【问题讨论】:

    标签: viber


    【解决方案1】:

    对于welcome_message,您应该在'conversation_started' 处理程序部分回显json_welcome_message,不要将其发送到send_message 端点。

    【讨论】:

    • 这正是我正在做的,我没有看到我想要的结果 if ($input['event'] == 'conversation_started') { $data['sender']['name'] = "EIR"; $data['type'] = "text"; $data['text'] = "welcome"; echo json_encode($data); ` }` 我在做什么错误的?这也很难测试,因为每个用户都会发送一次欢迎消息......或者有没有办法将它多次发送给同一个用户?谢谢!
    • 我建议您检查 webhook,并添加记录以记录收入和结果 json_message 以确保您收到 'conversation_started' 事件并测试您的解决方案。
    • 不行,你可以删除bot,conversation_started事件再次发生。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-15
    • 2018-05-03
    • 2010-10-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多