mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 22:49:53 -05:00
test
This commit is contained in:
parent
2f8b2ee3aa
commit
e0216142ca
@ -7,8 +7,6 @@ This is the SpiceBot AI system. Based On Chatty cathy
|
|||||||
import os
|
import os
|
||||||
import aiml
|
import aiml
|
||||||
|
|
||||||
from .Logs import logs
|
|
||||||
|
|
||||||
|
|
||||||
class SpiceBot_AI():
|
class SpiceBot_AI():
|
||||||
|
|
||||||
@ -23,23 +21,15 @@ class SpiceBot_AI():
|
|||||||
initial_dir = os.getcwd()
|
initial_dir = os.getcwd()
|
||||||
for plugin_dir in set(sopel_modules.__path__):
|
for plugin_dir in set(sopel_modules.__path__):
|
||||||
configsdir = os.path.join(plugin_dir, "SpiceBot_Configs")
|
configsdir = os.path.join(plugin_dir, "SpiceBot_Configs")
|
||||||
aimlstarter = os.path.join(configsdir, "std-startup.xml")
|
aimldir = os.path.join(configsdir, "aiml")
|
||||||
|
aimlstarter = os.path.join(aimldir, "std-startup.xml")
|
||||||
os.chdir(configsdir)
|
os.chdir(configsdir)
|
||||||
try:
|
self.aiml_kernel.learn(aimlstarter)
|
||||||
self.aiml_kernel.learn(aimlstarter)
|
self.aiml_kernel.respond("LOAD AIML B")
|
||||||
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))
|
|
||||||
os.chdir(initial_dir)
|
os.chdir(initial_dir)
|
||||||
# logs.log('SpiceBot_AI', "Found " + str(self.dict['counts']) + " " + 'aiml' + " commands.", True)
|
|
||||||
|
|
||||||
def on_message(self, message):
|
def on_message(self, message):
|
||||||
try:
|
aiml_response = self.aiml_kernel.respond(message)
|
||||||
aiml_response = self.aiml_kernel.respond(message)
|
|
||||||
except Exception as e:
|
|
||||||
aiml_response = e
|
|
||||||
return None
|
|
||||||
return aiml_response
|
return aiml_response
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user