<div class="page-header only-word">
        <div class="content flex-center " style="">
        <div class="container">
            <header class="post-header">
        <h1 class="post-title" style="">WordPress BotUI速通教程</h1>
        <div class="post-metas">
                            <span>最后更新于 2024-12-21</span>
                                    <a href="https://moecat.cc/author/nicocat/">
                    <span class="meta-author">
                        <img alt='nicocat' src='https://weavatar.com/avatar/1aeca73a20d6fea54d81269e6bc00175745e013f9a221a1ccd9492e2ff726287?s=24&#038;d=mm&#038;r=g' srcset='https://weavatar.com/avatar/1aeca73a20d6fea54d81269e6bc00175745e013f9a221a1ccd9492e2ff726287?s=48&#038;d=mm&#038;r=g 2x' class='avatar avatar-24 photo avatar-small' height='24' width='24' loading='lazy' decoding='async'/>                        nicocat                    </span>
                </a>
                                <span>2985 次阅读</span>
                            </div>
    </header>
            </div>
    </div>
</div>
<h2 class="wp-block-heading" id="h-botui-就是-关于-页的对话框">BotUI（就是<a href="https://nicocat.cc/about/" target="_blank" rel="nofollow noopener noreferrer">关于</a>页的对话框）</h2>



<p class="wp-block-paragraph">在博客放一个BotUI，BotUI使用，博客使用BotUI快速入门。</p>



<p class="wp-block-paragraph">转自：https://yangziwen.cn/2022/03/03/wordpress-botui/</p>



<p class="wp-block-paragraph">下载：</p>



<p class="wp-block-paragraph"><a href="https://nicocat.cc/mods/botui/botui.min.css" target="_blank" rel="noreferrer noopener" download="">https://nicocat.cc/mods/botui/botui.min.css</a><br><a href="https://nicocat.cc/mods/botui/botui-theme-default.css" target="_blank" rel="noreferrer noopener" download="">https://nicocat.cc/mods/botui/botui-theme-default.css</a><br><a href="https://nicocat.cc/mods/botui/botui.js" target="_blank" rel="noreferrer noopener" download="">https://nicocat.cc/mods/botui/botui.js</a><br><a href="https://nicocat.cc/mods/lib/vue.min.js" target="_blank" rel="noreferrer noopener" download="">https://nicocat.cc/mods/lib/vue.min.js</a></p>



<p class="wp-block-paragraph">然后在页面嵌入以下自定义html内容，在前面一部分使用类似的方式引入上面这四个文件即可。<br>回复配置请自行举一反三。</p>



<pre class="wp-block-code"><code>&lt;link rel="stylesheet" href="/mods/botui/botui.min.css"&gt;
&lt;link rel="stylesheet" href="/mods/botui/botui-theme-default.css"&gt;
&lt;script src="/mods/botui/botui.js"&gt;&lt;/script&gt;
&lt;script src="/mods/lib/vue.min.js"&gt;&lt;/script&gt;

&lt;div id="content" class="site-content"&gt;
    &lt;div class="entry-content"&gt;
        &lt;div class="popcontainer" id="fogforest"
            style="min-height:300px; padding:2px 6px 4px 6px; background-color: rgba(242, 242, 242,0.5); border-radius: 10px; border: 2px solid"&gt;
            &lt;center&gt;
                &lt;span style="font-size: large;"&gt;与&amp;nbsp;nicocat&amp;nbsp;对话中...&lt;/span&gt;
            &lt;/center&gt;
            &lt;bot-ui style="background-color: transparent;"&gt;
                &lt;center&gt;
                    &lt;div
                        style=" background-image: url(https://cdn.jsdelivr.net/gh/Karensky/cdn@1.0.6/botui/loading.svg);background-repeat: no-repeat;background-size: 10em;background-position: center;height: 10em;"&gt;
                    &lt;/div&gt;
                    &lt;p&gt;Loading&lt;/p&gt;
                &lt;/center&gt;
            &lt;/bot-ui&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
    function runBotui() {
        /*
        * BotUI回复配置
        */
        var botui = new BotUI("fogforest");
        botui.message.bot({
            delay: 200,
            content: "你好，喵！"
        }).then(function () {
            return botui.message.bot({
                delay: 1000,
                content: "我是兰啦罗喵~"
            })
        }).then(function () {
            return botui.message.bot({
                delay: 1000,
                content: "一位19岁的大学牲！👻"
            })
        }).then(function () {
            return botui.action.button({
                delay: 1500,
                action: &#91;{
                    text: "然后呢？ 😃",
                    value: "then"
                },
                {
                    text: "少废话！ 🙄",
                    value: "then2"
                }]
            })
        }).then(function (res) {
            if (res.value == "then") {
                then()
            }
            if (res.value == "then2") {
                then2()
            }
        });
        var then = function () {
            botui.message.bot({
                delay: 1500,
                content: "😘"
            }).then(function () {
                return botui.message.bot({
                    delay: 1500,
                    content: "喜欢瞎折腾"
                })
            }).then(function () {
                return botui.message.bot({
                    delay: 1500,
                    content: "目前在读电子商务专业..."
                })
            }).then(function () {
                return botui.message.bot({
                    delay: 1500,
                    content: "会写点网页，会一点营销..."
                })
            }).then(function () {
                return botui.message.bot({
                    delay: 1500,
                    content: "喜欢可爱的小萝莉..."
                })
            }).then(function () {
                return botui.action.button({
                    delay: 1500,
                    action: &#91;{
                        text: "看看你的",
                        value: "next"
                    }]
                })
            }).then(function (res) {
                return botui.message.bot({
                    delay: 1500,
                    content: '&lt;a target="_blank" rel="noopener" href="https://space.bilibili.com/413110087"&gt;看看我的B站作品&lt;/a&gt;&lt;/br&gt;&lt;a target="_blank" rel="noopener" href="https://github.com/nicocatxzc"&gt;看看我在github写的答辩&lt;/a&gt;'
                })
            })
        }
        var then2 = function () {
            botui.message.bot({
                delay: 1500,
                content:'&lt;a target="_blank" rel="noopener" href="https://files.nicocat.cc/wp-content/2024/12/黑手.mp4"&gt;好康的&lt;/a&gt;'
            }).then(function () {
                return botui.action.button({
                delay: 1500,
                action: &#91;{
                    text: "对不起",
                    value: "then"
                },
                {
                    text: "那咋了🙄",
                    value: "then2"
                }]
            })
            }
            ).then(function (res){
                if (res.value == "then") {
                then()
            }
            })
        }
    }
    try {
        runBotui()
    } catch (error) {
        if (error instanceof ReferenceError) {
            // handle this expected error
            console.log("botui cdn load failed, refresh");
            window.location.reload();
        } else {
            // handle unexpected error
            console.log("&#91;botui error]:", error);
        }
    }
&lt;/script&gt;</code></pre>
