Botkit 聊天机器人搭建积木

程序名称:Botkit

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

Botkit 介绍

botkit
一个用于构建聊天机器人、应用和定制集成的工具,旨在简化设计和运行在消息传递平台中底层交互的细节,为开发者提供构建任意类型的机器人的必要工具,也被称为“搭建积木”。

一些机器人像人一样说话,其他人则地在后台工作,还有另外一些机器人的界面很像现代的移动应用。 botkit
提供了一个易于理解的接口,用于发送和接收消息,以便开发者可以专注于构建新颖的应用程序和体验,而不是处理 API 端点。

var botkit = require('botkit');

var controller = botkit.slackbot({
  clientId: process.env.clientId,
  clientSecret: process.env.clientSecret,
  studio_token: process.env.studio_token,
});

controller.setupWebserver(process.env.port,function(err,webserver) {
    controller.createWebhookEndpoints(controller.webserver);
    controller.createOauthEndpoints(controller.webserver);
});

controller.hears('hello','direct_mention,direct_message', function(bot, message) {

  bot.reply(message,'Howdy!');

});

controller.hears('tacos','direct_mention,direct_message', function(bot, message) {

  bot.startConversation(message, function(err, convo) {
    convo.say('Oh boy, taco time!');
    convo.ask('What type of taco do you want?', function(answer, convo) {
      var taco_type = answer.text;
      // do something with this answer!
      // storeTacoType(convo.context.user, taco_type);
      convo.say('YUMMMM!!!'); // add another reply
      convo.next(); // continue with conversation
    });
  });
});

Botkit 官网

https://botkit.ai/

相关编程语言

Pacman 是一个软件包管理器, 作为 ArchLinux 发行版...
Smb4K 是KDE下的网络共享浏览器 更多屏幕截图请看:...
Wine (“Wine Is Not an Emulator” 的首字母缩写)...
虚拟桌面软件,可管理最多9个虚拟桌面,你可以用热键...
UNetbootin (Universal Netboot Installer)为一种跨...
Cobbler 可以用来快速建立 Linux 网络安装环境,它已...