mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
counts
This commit is contained in:
parent
c5a4c559cf
commit
9829751b4a
@ -40,6 +40,7 @@ class SpiceBot_AI():
|
|||||||
|
|
||||||
# Learn responses
|
# Learn responses
|
||||||
self.load_brain()
|
self.load_brain()
|
||||||
|
self.count_aiml_coms()
|
||||||
|
|
||||||
def load_brain(self):
|
def load_brain(self):
|
||||||
import sopel_modules
|
import sopel_modules
|
||||||
@ -51,6 +52,7 @@ class SpiceBot_AI():
|
|||||||
|
|
||||||
# learn directories
|
# learn directories
|
||||||
self.learn(braindirs)
|
self.learn(braindirs)
|
||||||
|
self.count_aiml_coms()
|
||||||
|
|
||||||
def load_bot_values(self, bot):
|
def load_bot_values(self, bot):
|
||||||
self.aiml_kernel.setBotPredicate("nick", bot.nick)
|
self.aiml_kernel.setBotPredicate("nick", bot.nick)
|
||||||
@ -88,13 +90,18 @@ class SpiceBot_AI():
|
|||||||
filepathlist.append(str(path))
|
filepathlist.append(str(path))
|
||||||
|
|
||||||
for aimlfile in filepathlist:
|
for aimlfile in filepathlist:
|
||||||
|
filereadgood = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
aiml_dict = untangle.parse(aimlfile)
|
dict_from_file = untangle.parse(aimlfile)
|
||||||
logs.log('SpiceBot_AI', aiml_dict)
|
logs.log('SpiceBot_AI', dict_from_file)
|
||||||
self.dict["counts"] += 1
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
filereadgood = False
|
||||||
logs.log('SpiceBot_AI', "Error loading %s: %s (%s)" % ('aiml', e, aimlfile))
|
logs.log('SpiceBot_AI', "Error loading %s: %s (%s)" % ('aiml', e, aimlfile))
|
||||||
|
|
||||||
|
if filereadgood and isinstance(dict_from_file, dict):
|
||||||
|
self.dict["counts"] += 1
|
||||||
|
else:
|
||||||
self.dict["failcounts"] += 1
|
self.dict["failcounts"] += 1
|
||||||
|
|
||||||
def on_message(self, bot, trigger, message):
|
def on_message(self, bot, trigger, message):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user