BOT UIを使ってBOTを作成する
1976 ワード
BOT UIとは
BOTを簡単に作れるJavaScriptフレームワーク。
2019年1月にやってみたことを書いていきます。
ドキュメント:docs.botui.org/index.html
例
Git
HTML
<div class="botui-app-container" id="botui-app">
<bot-ui></bot-ui>
</div>
js
Gitから抜粋
var botui = new BotUI('botui-app') // id of container
botui.message.bot({ // show first message
delay: 200,
content: 'hello'
}).then(() => {
return botui.message.bot({ // second one
delay: 1000, // wait 1 sec.
content: 'how are you?'
})
}).then(() => {
return botui.action.button({ // let user do something
delay: 1000,
action: [
{
text: 'Good',
value: 'good'
},
{
text: 'Really Good',
value: 'really_good'
}
]
})
}).then(res => {
return botui.message.bot({
delay: 1000,
content: `You are feeling ${res.text}!`
})
})
ひっかかったところ
最新のVue.jsだと動かなかった
<script src="https://cdn.jsdelivr.net/vue/latest/vue.min.js"></script>
fontawesomeはv4のアイコンから選ぶ。
Author And Source
この問題について(BOT UIを使ってBOTを作成する), 我々は、より多くの情報をここで見つけました https://qiita.com/ayungn/items/bb0215a908cf2207d65e著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .