This commit is contained in:
deathbybandaid 2019-06-05 09:11:02 -04:00
parent be2d0eea2a
commit 400c08af90
2 changed files with 8 additions and 8 deletions

View File

@ -23,6 +23,9 @@ class SpiceBot_AI_MainSection(StaticSection):
class SpiceBot_AI(): class SpiceBot_AI():
def __init__(self): def __init__(self):
botconfig.define_section("SpiceBot_AI", SpiceBot_AI_MainSection, validate=False)
self.braindirs = [] self.braindirs = []
self.dict = { self.dict = {
"counts": 0, "counts": 0,
@ -49,9 +52,6 @@ class SpiceBot_AI():
# Load bot values # Load bot values
self.load_bot_values() self.load_bot_values()
def botai_config(self):
botconfig.define_section("SpiceBot_AI", SpiceBot_AI_MainSection, validate=False)
def load_saved_brain(self): def load_saved_brain(self):
if os.path.isfile(botconfig.config.aibrain): if os.path.isfile(botconfig.config.aibrain):
self.aiml_kernel.bootstrap(brainFile=botconfig.config.aibrain) self.aiml_kernel.bootstrap(brainFile=botconfig.config.aibrain)

View File

@ -77,20 +77,20 @@ class BotChannels():
self.lock.release() self.lock.release()
def join_all_channels(self, bot): def join_all_channels(self, bot):
if bot.config.SpiceBot_Channels.joinall: if botconfig.SpiceBot_Channels.joinall:
for channel in self.dict['list'].keys(): for channel in self.dict['list'].keys():
if channel.startswith("#"): if channel.startswith("#"):
if channel not in bot.channels.keys() and channel not in bot.config.SpiceBot_Channels.chanignore: if channel not in bot.channels.keys() and channel not in botconfig.SpiceBot_Channels.chanignore:
bot.write(('JOIN', bot.nick, self.dict['list'][channel]['name'])) bot.write(('JOIN', bot.nick, self.dict['list'][channel]['name']))
if channel not in bot.channels.keys() and bot.config.SpiceBot_Channels.operadmin: if channel not in bot.channels.keys() and botconfig.SpiceBot_Channels.operadmin:
bot.write(('SAJOIN', bot.nick, self.dict['list'][channel]['name'])) bot.write(('SAJOIN', bot.nick, self.dict['list'][channel]['name']))
def chanadmin_all_channels(self, bot): def chanadmin_all_channels(self, bot):
# Chan ADMIN +a # Chan ADMIN +a
for channel in bot.channels.keys(): for channel in bot.channels.keys():
if channel.startswith("#"): if channel.startswith("#"):
if channel not in bot.config.SpiceBot_Channels.chanignore: if channel not in bot.configSpiceBot_Channels.chanignore:
if bot.config.SpiceBot_Channels.operadmin: if botconfig.SpiceBot_Channels.operadmin:
if not bot.channels[channel].privileges[bot.nick] < sopel.module.ADMIN: if not bot.channels[channel].privileges[bot.nick] < sopel.module.ADMIN:
bot.write(('SAMODE', channel, "+a", bot.nick)) bot.write(('SAMODE', channel, "+a", bot.nick))
else: else: