mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-11 06:00:59 -05:00
test
This commit is contained in:
parent
a9bbfa936f
commit
32c75dabc8
@ -23,13 +23,13 @@ class SpiceBot_AI():
|
||||
for plugin_dir in set(sopel_modules.__path__):
|
||||
configsdir = os.path.join(plugin_dir, "SpiceBot_Configs")
|
||||
aimldir = os.path.join(configsdir, "aiml")
|
||||
for aimlfile in os.listdir(aimldir):
|
||||
aiml_filename = os.path.join(aimldir, aimlfile)
|
||||
try:
|
||||
self.aiml_kernel.learn(aiml_filename)
|
||||
self.dict['counts'] += 1
|
||||
except Exception as e:
|
||||
logs.log('SpiceBot_AI', "Error loading %s: %s (%s)" % ('aiml', e, aiml_filename))
|
||||
aimlstarter = os.path.join(aimldir, "std-startup.xml")
|
||||
try:
|
||||
self.aiml_kernel.learn(aimlstarter)
|
||||
self.aiml_kernel.respond("LOAD AIML B")
|
||||
self.dict['counts'] += 1
|
||||
except Exception as e:
|
||||
logs.log('SpiceBot_AI', "Error loading %s: %s (%s)" % ('aiml', e, aimlstarter))
|
||||
logs.log('SpiceBot_AI', "Found " + str(self.dict['counts']) + " " + 'aiml' + " commands.", True)
|
||||
|
||||
def on_message(self, message):
|
||||
|
||||
22
sopel_modules/SpiceBot_Configs/aiml/std-startup.xml
Normal file
22
sopel_modules/SpiceBot_Configs/aiml/std-startup.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<aiml version="1.0.1" encoding="UTF-8">
|
||||
<!-- std-startup.xml -->
|
||||
|
||||
<!-- Category is an atomic AIML unit -->
|
||||
<category>
|
||||
|
||||
<!-- Pattern to match in user input -->
|
||||
<!-- If user enters "LOAD AIML B" -->
|
||||
<pattern>LOAD AIML B</pattern>
|
||||
|
||||
<!-- Template is the response to the pattern -->
|
||||
<!-- This learn an aiml file -->
|
||||
<template>
|
||||
<learn>aiml/*</learn>
|
||||
<!-- All aiml files are relative to the run dir and must be subdirs,
|
||||
E.g. ./aiml/alice/one.aiml, ./aiml/custom/mine.aiml -->
|
||||
|
||||
</template>
|
||||
|
||||
</category>
|
||||
|
||||
</aiml>
|
||||
Loading…
Reference in New Issue
Block a user