bootdesk/chat-sdk-botman-compat
Composer 安装命令:
composer require bootdesk/chat-sdk-botman-compat
包简介
BotMan compatibility shim for bootdesk
README 文档
README
BotMan compatibility shim. Drop-in replacement for botman/botman using laravel-bootdesk under the hood. No botman dependency required.
Install
composer require bootdesk/chat-sdk-botman-compat
Quick Start
use BotMan\BotMan\BotManFactory; use BootDesk\ChatSDK\Core\Chat; $bot = BotManFactory::createForChat($chat); $bot->hears('hello', function ($message, $bot) { $bot->reply('Hello!'); }); $bot->hears('my name is {name}', function ($message, $bot, $params) { $bot->reply("Hi {$params['name']}!"); }); $bot->fallback(function ($message, $bot) { $bot->reply("I don't understand."); });
API Mapping
| BotMan | laravel-bootdesk |
|---|---|
hears(pattern, callback) |
Chat::onNewMessage(pattern, callback) |
reply(message) |
Thread::post(message) |
say(message, threadId) |
Chat::thread(id)->post(message) |
fallback(callback) |
Unmatched message handler |
ask(question, callback) |
Next-message callback pattern |
startConversation(conv) |
ConversationManager::start() |
group(attrs, callback) |
Register handlers in group |
listen() |
No-op (webhook-driven) |
getUser() |
Message author |
typesAndWaits(seconds) |
Thread::startTyping() |
Question / Answer
use BotMan\BotMan\Messages\Outgoing\Question; use BotMan\BotMan\Messages\Outgoing\Button; $question = Question::create('Continue?') ->fallback('Choose yes or no') ->callbackId('continue') ->addButton(Button::create('Yes')->value('yes')) ->addButton(Button::create('No')->value('no')); $bot->ask($question, function ($answer) use ($bot) { if ($answer->isInteractiveMessageReply()) { $bot->reply("You chose: {$answer->getValue()}"); } });
Conversations
use BotMan\BotMan\Conversations\Conversation; class OnboardingConversation extends Conversation { public function run(): void { $this->ask('What is your name?', function ($answer) { $name = $answer->getText(); $this->say("Welcome, {$name}!"); }); } } $bot->startConversation(new OnboardingConversation);
Attachments
use BotMan\BotMan\Messages\Outgoing\OutgoingMessage; use BotMan\BotMan\Messages\Attachments\Image; use BotMan\BotMan\Messages\Attachments\Video; use BotMan\BotMan\Messages\Attachments\Audio; use BotMan\BotMan\Messages\Attachments\File; use BotMan\BotMan\Messages\Attachments\Location; // Image $message = OutgoingMessage::create('Here is a photo') ->withAttachment(new Image('https://example.com/photo.jpg')); // Video $message = OutgoingMessage::create('Check this out') ->withAttachment(new Video('https://example.com/video.mp4')); // Audio $message = OutgoingMessage::create('Listen to this') ->withAttachment(new Audio('https://example.com/audio.mp3')); // File $message = OutgoingMessage::create('Document attached') ->withAttachment(new File('https://example.com/doc.pdf')); // Location $message = OutgoingMessage::create('We are here') ->withAttachment(new Location(40.7128, -74.0060)); $bot->reply($message);
Not Supported
sendRequest()-- no low-level platform API passthroughlisten()-- no-op; laravel-bootdesk is webhook-driven- Driver-specific features -- only cross-platform abstractions are available
Documentationn
Full API documentation: https://bootdesk.github.io/chat-sdk
License
MIT
bootdesk/chat-sdk-botman-compat 适用场景与选型建议
bootdesk/chat-sdk-botman-compat 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bootdesk/chat-sdk-botman-compat 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bootdesk/chat-sdk-botman-compat 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 41
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-18