问题标签 [botman]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
symfony - 使用 botman 发送电子邮件
我一直在尝试与 botman 发送电子邮件。以防 botman 无法回答用户。将向管理员发送一封电子邮件,以便他自己回答。该功能工作得很好(我已经测试过了)但是当我尝试将它添加到botman的发送消息功能时它不起作用。这是我的功能:
php - 带有 VK 社区回调驱动程序的 Botman Studio 在组内听不到工作
- 听到和后备都很好:
- 有 VK 驱动程序的组内听到NOT WORKS,但后备WORKS:
我想做的一切——例如用于 VK 和 Telegram 的通用机器人,但我需要检查用户是否在目标平台的黑名单中,所以如果“驱动程序”类似于来自 botman 的“MatchingMiddleware”——我不明白为什么听到在“组”内不起作用,这是来自网站的官方示例: 官方 botman 视频教程截图
这个例子也不起作用:https ://botman.io/2.0/receiving#command-groups-drivers
在 VK Driver 网站上没有关于“组”的信息:https ://github.com/yageorgiy/botman-vk-community-callback-driver
php - 带有 PHP artisan 和 ngrok 的 Botman Studio 本地图像附件
我使用 php artisan serve 将 Botman Studio 与 XAMPP 捆绑包中的 PHP 7.4.22 一起使用。
我想要使用Image Intervention进行图像处理,并使用web.php作为jpg响应来路由它。
这适用于浏览器:
但是在 Botman(VK 和 Telegram)中不起作用(说而不是回复,因为它在对话中):
例如,如果我使用公共文件夹中的真实图像文件,则也不起作用:
唯一在 PowerShell 中以某种方式直接解决此响应的问题:
致命错误:第 59 行的 E:\YandexDisk\www\vapebot\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php 中的最大执行时间超过了 60 秒
我认为有些东西会阻止 VK 或 Telegram 对图像的请求,但我不知道是什么阻止了它(VerifyCsrfToken * in $except - 也无济于事)。
如果我在机器人执行附件时尝试打开与图片相同的链接,那么浏览器也会进入“无限加载”状态。
我试图用谷歌搜索关于这个问题的任何东西,但没有运气,因为代码本身没有什么奇怪的。
这方面的证据是,例如,如果我附上来自 imgur 的图片(或没有 botman studio 的干净文件夹,以及来自 ampps 下的另一个 ngrok 的图像文件),那么就没有问题,这很有效:
在 tinker 中,一切正常: 使用 $img->save() 进行响应预览 使用带有 *.jpg 的路由进行响应预览
我什至尝试安装新的 Laravel,然后需要 Botman(没有工作室)和 Image Intervention - 结果相同:(
我还发现了来自 VkCommunityCallbackDriver.php 的代码(可能是 Telegram 使用相同的代码)可能与此问题相关,并且尝试在公共目录中模拟它也不起作用:
laravel - Laraavel Botman 获取消息 ID
- 机器人版本:2.6.1
- PHP版本:7.3|8.0
- 消息服务:Web
- 缓存驱动:Laravel
描述:
我试图删除最后一条机器人消息。我怎样才能做到这一点?
重现步骤:
我使用 ask 方法来获取答案 id
$this->ask('问我什么?' function($answer){ $this->say(json_encode($this->bot->getMessage()->getPayload()));
}) 得到了这个结果:
要发送删除请求,我需要消息 ID
$apiParameters = [ 'chat_id' => '', 'message_id' => '' ]; $this->bot->sendRequest('deleteMessage', $apiParameters);
谢谢!
laravel-6 - Laravel 中的 Botman,无法使用 auth() 助手访问登录用户
使用 Botman 时,我无法通过 auth() 助手或外观 Auth:: 访问登录用户。
我的僵尸路线:
我的 routeServiceProvider.php :
我也可以在我的网络路由中正常检索登录用户
让我知道我是否做错了什么。如果需要,我可以详细说明一些要点。
php - botman 如何将整个对话服务到 mysql 中
我正在将我的 laravel 应用程序与 botman 集成。我希望能够将所有对话存储到 mysql 中,然后构建一个管理界面来查看所有提出的问题。我希望我的聊天机器人能够从 mysql 表中获取响应,该表将具有以下字段 id_chat name (client) question response email ip
telegram - 什么可能导致我的 Telegram webhook 不断调用?
我有一个简单的 PHP 脚本(使用 Botman),由我的 Telegram 机器人通过 webhook 调用。它应该在收到关键字时做出响应。这有效,将响应消息发送到我的手机。
然而,它随机地重复消息,没有任何输入。虽然是随机的,但它如此频繁,我估计它每分钟至少执行 10 次。
认为这可能是由于某些网络机器人调用了我的 URL,我修改了脚本以检查是否存在(及其值)和查询参数,并且所有随机消息都停止了。网络机器人不会知道这个秘密参数,对吧?
正如预期的那样,一旦我更新了 PHP 脚本(没有使用修改后的 webhook 更新 Telegram),消息就停止了。到现在为止还挺好。
接下来,使用包含秘密查询参数的 webhook 更新 Telegram,然后等待 5 分钟。没有消息:仍然看起来不错。
唉,一旦我发送我的关键字,它会给出预期的响应,但随后又会无休止地重复。
我在哪里寻找解决这个问题?
附言。为了测试,该脚本还返回用户的一般信息。我可以看到它不断在重复的消息中返回我的信息,就好像我提出了每个请求一样。这可能是 Telegram 的错误吗?
php-7.3 - Is it wrong to have a constructor in a class extending from Conversation Class in Botman (PHP)?
I'm using Botman 2.6 directly in a PHP 7.3 app (i.e. not Botman Studio/ Laravel).
The code is meant to start a conversation that asks 2 initial questions. Then ask another question one or more times, depending on the user's response to a prompt "Ask more?". (That's right, ask same question ad infinitum as long as reply is affirmative!)
It isn't working fully as expected so I'm working my way through what could be wrong.
The main PHP script has:
The first conversation's class is:
When the code is run, it asks the first question but not the second. For this reason I am thinking the issue has nothing to do with the 2nd conversation class (though given below.) Is there something wrong with using a __construct function in the conversation class? In all google searched samples, I've never seen this done but it serves my purpose here.
The second conversation class: