AIML Bot 根据时间响应

AIML Bot Response According To Time

如何让bot根据时间响应?这是代码

<aiml>

<category>
<pattern>GOOD MORNING</pattern>
<template>
    <think><set name="hour"><date format="%H:%M"/></set></think>
    <condition name="hour">
        <li value="10:54">Hello and how are you this morning?</li>
        <li value="11:35">Hello and how are you this morning?</li>
    </condition>
</template>
</category>

</aiml>

我希望我的机器人根据小时和分钟做出响应,该怎么做?代码有问题吗

虽然这可行,但您需要为一天中的每一分钟制作 <li> 标签!您可能还需要删除您的 : 取决于您的规范化文件。

虽然你真的只需要检查小时,分钟并不重要。

<category>
<pattern>GOOD MORNING</pattern>
<template>
<think><set name="hour"><date format="%H"/></set></think>
<condition name="hour">
    <li value="00">Hello, it's more like the middle of the night than morning.</li> 
    <li value="01">Hello, it's only just morning. How are you this morning?</li> 
    <li value="02">Hello, it's only just morning. How are you this morning?</li> 
    <li value="03">Hello and how are you this morning?</li> 
    <li value="04">Hello and how are you this morning?</li> 
    <li value="05">Hello and how are you this morning?</li> 
    <li value="06">Hello and how are you this morning?</li> 
    <li value="07">Hello and how are you this morning?</li> 
    <li value="08">Hello and how are you this morning?</li> 
    <li value="09">Hello and how are you this morning?</li> 
    <li value="10">Hello and how are you this morning?</li> 
    <li value="11">Hello and how are you this morning?</li> 
    <li value="12">You're a bit late. It's lunchtime here.</li> 
    <li value="13">You're a bit late. It's lunchtime here.</li> 
    <li value="14">Morning?! It's the afternoon here.</li> 
    <li value="15">Morning?! It's the afternoon here.</li> 
    <li value="16">Morning?! It's the afternoon here.</li> 
    <li value="17">Morning?! It's nearly evening.</li> 
    <li value="18">Morning?! It's evening here.</li> 
    <li value="19">Morning?! It's evening here.</li> 
    <li value="20">Morning?! It's evening here.</li> 
    <li value="21">Morning?! It's night time here.</li> 
    <li value="22">Morning?! It's night time here.</li> 
    <li value="23">Morning?! It's night time here.</li>
</condition>
</template>
</category>