Don't load modules if we don't have any servers configured
This commit is contained in:
parent
dccb460e5c
commit
28a00e01de
1 changed files with 10 additions and 7 deletions
17
start.py
17
start.py
|
@ -45,14 +45,17 @@ bot = IRCBot.Bot(directory, args, cache, config, database, events,
|
||||||
|
|
||||||
whitelist = bot.get_setting("module-whitelist", [])
|
whitelist = bot.get_setting("module-whitelist", [])
|
||||||
blacklist = bot.get_setting("module-blacklist", [])
|
blacklist = bot.get_setting("module-blacklist", [])
|
||||||
modules.load_modules(bot, whitelist=whitelist, blacklist=blacklist)
|
|
||||||
|
|
||||||
servers = []
|
server_configs = bot.database.servers.get_all()
|
||||||
for server_id, alias in bot.database.servers.get_all():
|
if len(server_configs):
|
||||||
server = bot.add_server(server_id, connect=False)
|
modules.load_modules(bot, whitelist=whitelist, blacklist=blacklist)
|
||||||
if not server == None:
|
|
||||||
servers.append(server)
|
servers = []
|
||||||
if len(servers):
|
for server_id, alias in server_configs:
|
||||||
|
server = bot.add_server(server_id, connect=False)
|
||||||
|
if not server == None:
|
||||||
|
servers.append(server)
|
||||||
|
|
||||||
bot._events.on("boot.done").call()
|
bot._events.on("boot.done").call()
|
||||||
|
|
||||||
timers.setup(bot.find_settings_prefix("timer-"))
|
timers.setup(bot.find_settings_prefix("timer-"))
|
||||||
|
|
Loading…
Reference in a new issue