よく使う処理をまとめる方法をご紹介します。
実装方法
よく使う処理を別の<category>
に分けておくと、任意の場所から<srai>
で呼び出すことができます。
xAIML
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<category> <pattern>こんちわ</pattern> <template> <srai>こんにちは</srai> </template> </category> <category> <pattern>こんにちは</pattern> <template> はい、こんにちは </template> </category> |
実行結果
1 2 |
user > こんちわ bot > はい、こんにちは |