@abbott-platform/botkit 中文文档教程
Botkit - Building Blocks for Building Bots
Botkit 旨在简化设计和运行生活在消息传递平台内的有用的、有创意的机器人的过程。 机器人是可以发送和接收消息的应用程序,在许多情况下,它们作为用户与人类同行一起出现。
一些机器人像人一样说话,另一些在后台静静地工作,而另一些则呈现出非常像现代的界面移动应用程序。 Botkit 为开发人员提供了构建任何类型机器人的必要工具! 它为发送和接收消息提供了一个易于理解的界面,以便开发人员可以专注于创建新颖的应用程序和体验,而不是处理 API 端点。
我们对 Botkit 的目标是让任何有创造欲望的人都能轻松、有趣地构建机器人 一个充满会说话的机器的未来! 我们提供多种工具来实现这一愿景:
- Botkit Studio, an integrated development environment for designing and building bots
- Starter Kits, boilerplate applications pre-configured to work with popular platforms
- Botkit Core Library, an SDK for creating conversational software
- Plugins and Middlewares that can extend and enhance your bot
Botkit 具有一套全面的工具来处理流行的消息传递平台,包括:
- Slack
- Cisco Spark
- Facebook Messenger and Facebook @Workplace
- Twilio SMS Messaging
- Twilio IP Messaging
- Microsoft Bot Framework
- Yours? info@howdy.ai
Start with Botkit Studio
Botkit Studio 是一个托管开发环境,用于使用 Botkit 构建机器人。 使用 Botkit Studio 的开发人员可以获得 Botkit 的全部功能,并增加了许多强大的机器人构建功能,例如:
- All the code you need to get your bot online in minutes
- A visual authoring environment for designing and managing dialog
- A real-time message console for monitoring activity
- APIs that enable content and features to be added to bots without additional code
- Role-based, multi-user teams support
- Detailed usage statistics
- Built-in integrations with top plugins and platform tools
单击下面注册一个免费的开发人员帐户,和如果您有任何问题,请联系我们。
Start with a Starter Kit
根据我们自 Botkit 发布以来建立的最佳实践,我们的入门工具包包括 在几分钟内将 Botkit 机器人上线所需的一切。 不要从头开始——从一个开始 结构良好,可扩展的应用程序样板!
这些入门工具包很容易在您自己的托管服务上设置和运行,但是获得最快(和最便宜)的方式 started 是直接部署到 Glitch,一个免费使用的代码编辑器和托管系统!
注意:虽然强烈建议使用 Botkit Studio,但也可以在不注册 Studio 的情况下使用这些入门工具包。
Slack Bot Starter Kit
Slack 入门工具包包含创建多团队 Slack 应用程序所需的一切, 适合内部使用或提交给 Slack 的应用商店。
Cisco Spark Bot Starter Kit
在 Cisco Spark 的协作和消息传递平台内构建一个机器人。 使用入门套件构建的机器人 准备提交到 Cisco Spark 的 Depot 应用商店。
Facebook Bot Starter Kit
Facebook 入门工具包包含在 Facebook Messenger 或 Facebook Work Chat 上建立 Facebook 机器人所需的所有代码。 只需几项配置,即可设置一个自动响应发送到您的 Facebook 页面的消息的机器人。
Developer & Support Community
加入我们由 Botkit 开发人员和广大机器人爱好者组成的繁荣社区。 我们开放的 Slack 群组拥有超过 4500 名成员 这里 适合对制造机器人的艺术和科学感兴趣的人。 快来提问,分享你的进步,和你的同龄人一起交流吧!
您还可以在我们专门的 Cisco Spark 房间中寻求 Botkit 团队成员的帮助!
我们还举办名为 TALKABOT 的定期聚会和年度会议。 来认识其他机器人开发人员并向他们学习! YouTube 上提供了我们 2016 年活动的完整视频
Botkit Core Library
。Botkit 的设计理念是为开发人员提供一种类似语言的语言用于构建机器人的界面。 Botkit 不直接处理消息平台协议和 API,而是提供语义功能 围绕人类对话的正常部分设计:听到的东西和说出的东西。
在这些基本构建块之上,Botkit 提供了一个强大的系统来创建和管理动态 对话界面,并利用人工智能 (AI) 等尖端技术 和自然语言理解 (NLP/NLU) 工具。
实际上,这会导致代码如下所示:
// respond when a user sends a DM to the bot that says "hello"
controller.hears('hello', 'direct_message', function(bot, message) {
bot.reply(message, 'Hello human.');
});
为任何平台构建的所有 Botkit 机器人都使用这些相同的构建块。 这意味着不需要开发人员 了解每个平台的复杂性,并可以构建可以在它们之间轻松移植的机器人。
Botkit 可用于构建独立的应用程序,也可集成到现有的 Node.js 中 提供机器人体验或将应用程序通知发送到消息传递应用程序的应用程序。 它被释放 在 MIT 开源许可证下,这意味着开发人员可以自由选择任何方式使用它, 在任何类型的项目中。
Install Botkit from NPM or Github
Botkit 可通过 NPM 获得。
npm install --save botkit
您还可以直接从 Git 查看 Botkit。 如果您想使用示例代码和包含的机器人,最好使用 Github 而不是 NPM。
git clone git@github.com:howdyai/botkit.git
克隆 Git 存储库后,您必须安装节点依赖项。 导航到克隆存储库的根目录并使用 npm 安装所有必要的依赖项。
npm install
使用 --production
标志跳过从 Botkit 安装 devDependencies。 如果您只想运行示例机器人,则很有用。
npm install --production
Running Tests
要运行测试,请使用 npm test
命令。 注意:您需要使用 npm install
安装开发依赖项。
npm test
要以监视模式运行
npm run test-watch
测试:使用 Jest 运行测试。 您可以在 --
之后传递 Jest 命令行选项。 例如,要让 Jest 在第一个错误时保释,您可以运行
npm test -- --bail
Documentation
- Get Started
- Botkit Studio API
- Function index
- Extending Botkit with Plugins and Middleware
- List of current plugins
- Storing Information
- Logging
- Platforms
- Slack
- Cisco Spark
- Facebook Messenger
- Twilio SMS
- Twilio IPM
- Microsoft Bot Framework
- Contributing to Botkit
- Contributing to Botkit Core
- Building Middleware/plugins
- Building platform connectors
About Botkit
Botkit 是 Howdy 的产物。
如需支持,请查看开发者社区并在#Botkit 频道中找到我们的团队。
Botkit - Building Blocks for Building Bots
Botkit is designed to ease the process of designing and running useful, creative bots that live inside messaging platforms. Bots are applications that can send and receive messages, and in many cases, appear alongside their human counterparts as users.
Some bots talk like people, others silently work in the background, while others present interfaces much like modern mobile applications. Botkit gives developers the necessary tools for building bots of any kind! It provides an easy-to-understand interface for sending and receiving messages so that developers can focus on creating novel applications and experiences instead of dealing with API endpoints.
Our goal with Botkit is to make bot building easy, fun, and accessible to anyone with the desire to create a future filled with talking machines! We provide several tools to make this vision a reality:
- Botkit Studio, an integrated development environment for designing and building bots
- Starter Kits, boilerplate applications pre-configured to work with popular platforms
- Botkit Core Library, an SDK for creating conversational software
- Plugins and Middlewares that can extend and enhance your bot
Botkit features a comprehensive set of tools to deal with popular messaging platforms, including:
- Slack
- Cisco Spark
- Facebook Messenger and Facebook @Workplace
- Twilio SMS Messaging
- Twilio IP Messaging
- Microsoft Bot Framework
- Yours? info@howdy.ai
Start with Botkit Studio
Botkit Studio is a hosted development environment for building bots with Botkit. Developers using Botkit Studio get the full capabilities of Botkit, with the addition of many powerful bot-building features such as:
- All the code you need to get your bot online in minutes
- A visual authoring environment for designing and managing dialog
- A real-time message console for monitoring activity
- APIs that enable content and features to be added to bots without additional code
- Role-based, multi-user teams support
- Detailed usage statistics
- Built-in integrations with top plugins and platform tools
Click below to sign up for a free developer account, and please contact us if you have any questions.
Start with a Starter Kit
Based on the best practices we've established since the release of Botkit, our starter kits include everything you need to bring a Botkit bot online in minutes. Don't start from scratch -- start with a well structured, extensible application boilerplate!
These starter kits are easy to set up and run on your own hosting service, but the fastest (and cheapest) way to get started is to deploy directly to Glitch, a free-to-use code editor and hosting system!
Note: While using Botkit Studio is highly recommended, these starter kits can be used without registering for Studio as well.
Slack Bot Starter Kit
The Slack starter kit contains everything you need to create a multi-team Slack application, suitable for internal use or submission to Slack's app store.
Cisco Spark Bot Starter Kit
Build a bot inside Cisco Spark's collaboration and messaging platform. Bots built with the starter kit are ready to submit to Cisco Spark's Depot app store.
Facebook Bot Starter Kit
The Facebook starter kit contains all the code necessary to stand up a Facebook bot on either Facebook Messenger, or Facebook Work Chat. With just a few pieces of configuration, set up a bot that automatically responds to messages sent to your Facebook page.
Developer & Support Community
Join our thriving community of Botkit developers and bot enthusiasts at large. Over 4500 members strong, our open Slack group is the place for people interested in the art and science of making bots. Come to ask questions, share your progress, and commune with your peers!
You can also find help from members of the Botkit team in our dedicated Cisco Spark room!
We also host a regular meetup and annual conference called TALKABOT. Come meet and learn from other bot developers! Full video of our 2016 event is available on Youtube.
Botkit Core Library
Botkit is designed around the idea of giving developers a language-like interface for building bots. Instead of dealing directly with messaging platform protocols and APIs, Botkit provides semantic functions designed around the normal parts of human conversation: hearing things and saying things.
On top of these basic build blocks, Botkit offers a powerful system for creating and managing dynamic conversational interfaces, and tapping into cutting edge technology like artificial intelligence (AI) and natural language understanding (NLP/NLU) tools.
Practically speaking, this results in code that looks like this:
// respond when a user sends a DM to the bot that says "hello"
controller.hears('hello', 'direct_message', function(bot, message) {
bot.reply(message, 'Hello human.');
});
All Botkit bots, built for any platform, use these same building blocks. This means developers are not required to learn the intricacies of each platform, and can build bots that port easily between them.
Botkit can be used to build a stand-alone application, or it can be integrated into existing Node.js apps to offer a bot experience, or to send application notifications into messaging apps. It is released under the MIT open source license, which means developers are free to use it any way they choose, in any type of project.
Install Botkit from NPM or Github
Botkit is available via NPM.
npm install --save botkit
You can also check out Botkit directly from Git. If you want to use the example code and included bots, it may be preferable to use Github over NPM.
git clone git@github.com:howdyai/botkit.git
After cloning the Git repository, you have to install the node dependencies. Navigate to the root of your cloned repository and use npm to install all necessary dependencies.
npm install
Use the --production
flag to skip the installation of devDependencies from Botkit. Useful if you just wish to run the example bot.
npm install --production
Running Tests
To run tests, use the npm test
command. Note: you will need dev dependencies installed using npm install
.
npm test
To run tests in watch mode run:
npm run test-watch
Tests are run with Jest. You can pass Jest command line options after a --
. For example to have Jest bail on the first error you can run
npm test -- --bail
Documentation
- Get Started
- Botkit Studio API
- Function index
- Extending Botkit with Plugins and Middleware
- List of current plugins
- Storing Information
- Logging
- Platforms
- Slack
- Cisco Spark
- Facebook Messenger
- Twilio SMS
- Twilio IPM
- Microsoft Bot Framework
- Contributing to Botkit
- Contributing to Botkit Core
- Building Middleware/plugins
- Building platform connectors
About Botkit
Botkit is a product of Howdy.
For support, check out the Developer Community and find our team in the #Botkit channel.