<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Botkit聊天機(jī)器人搭建積木

          聯(lián)合創(chuàng)作 · 2023-09-30 03:14

          Botkit 是一個(gè)用于構(gòu)建聊天機(jī)器人、應(yīng)用和定制集成的工具,旨在簡(jiǎn)化設(shè)計(jì)和運(yùn)行在消息傳遞平臺(tái)中底層交互的細(xì)節(jié),為開發(fā)者提供構(gòu)建任意類型的機(jī)器人的必要工具,也被稱為“搭建積木”。

          一些機(jī)器人像人一樣說(shuō)話,其他人則默默地在后臺(tái)工作,還有另外一些機(jī)器人的界面很像現(xiàn)代的移動(dòng)應(yīng)用。 Botkit 提供了一個(gè)易于理解的接口,用于發(fā)送和接收消息,以便開發(fā)者可以專注于構(gòu)建新穎的應(yīng)用程序和體驗(yàn),而不是處理 API 端點(diǎn)。

          Botkit Code Basics

          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
              });
            });
          });
          瀏覽 30
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲黄色电影院 | 成人在线视频网站 | 51精品人人搡人人妻 | 国产欧美欧美金五星的户外操逼。 | 亚洲一级二级 |