diff --git a/sopel_modules/SpiceBot_AI/AI.py b/sopel_modules/SpiceBot_AI/AI.py index 8fd489a..70b1e9a 100644 --- a/sopel_modules/SpiceBot_AI/AI.py +++ b/sopel_modules/SpiceBot_AI/AI.py @@ -7,7 +7,8 @@ import sopel.module import spicemanip from sopel_modules.SpiceBot_SBTools import sopel_triggerargs, googlesearch, bot_privs, inlist, inlist_match, similar_list -from sopel_modules.SpiceBot_Events.System import bot_events_check, botevents +from sopel_modules.SpiceBot_Events.System import bot_events_check, BotEvents +botevents = BotEvents() @sopel.module.nickname_commands('(.*)') diff --git a/sopel_modules/SpiceBot_Channels/Channels.py b/sopel_modules/SpiceBot_Channels/Channels.py index 34db283..efe0332 100644 --- a/sopel_modules/SpiceBot_Channels/Channels.py +++ b/sopel_modules/SpiceBot_Channels/Channels.py @@ -6,8 +6,8 @@ from __future__ import unicode_literals, absolute_import, print_function, divisi import sopel.module from sopel.config.types import StaticSection, ValidatedAttribute, ListAttribute -from sopel_modules.SpiceBot_Events.System import bot_events_startup_register, bot_events_recieved, bot_events_trigger, botevents - +from sopel_modules.SpiceBot_Events.System import bot_events_startup_register, bot_events_recieved, bot_events_trigger, BotEvents +botevents = BotEvents() from sopel_modules.SpiceBot_SBTools import ( join_all_channels, chanadmin_all_channels, channel_list_current, bot_logging diff --git a/sopel_modules/SpiceBot_Channels/Channels_Command.py b/sopel_modules/SpiceBot_Channels/Channels_Command.py index c7e69bc..906f5ea 100644 --- a/sopel_modules/SpiceBot_Channels/Channels_Command.py +++ b/sopel_modules/SpiceBot_Channels/Channels_Command.py @@ -6,7 +6,8 @@ import sopel.module import spicemanip -from sopel_modules.SpiceBot_Events.System import bot_events_check, botevents +from sopel_modules.SpiceBot_Events.System import bot_events_check, BotEvents +botevents = BotEvents() from sopel_modules.SpiceBot_SBTools import ( sopel_triggerargs, inlist, channel_privs, join_all_channels, channel_list_current, diff --git a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py index 2d9e2ce..9079215 100644 --- a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py +++ b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py @@ -7,7 +7,8 @@ import sopel.module import os -from sopel_modules.SpiceBot_Events.System import bot_events_startup_register, bot_events_recieved, bot_events_trigger, botevents +from sopel_modules.SpiceBot_Events.System import bot_events_startup_register, bot_events_recieved, bot_events_trigger, BotEvents +botevents = BotEvents() from sopel_modules.SpiceBot_SBTools import bot_logging import spicemanip diff --git a/sopel_modules/SpiceBot_Events/Events.py b/sopel_modules/SpiceBot_Events/Events.py index 730cb4f..736f595 100644 --- a/sopel_modules/SpiceBot_Events/Events.py +++ b/sopel_modules/SpiceBot_Events/Events.py @@ -5,7 +5,8 @@ from __future__ import unicode_literals, absolute_import, division, print_functi import sopel.module from sopel.trigger import PreTrigger -from .System import bot_events_trigger, bot_events_recieved, bot_events_startup_check, bot_events_setup_check, botevents +from .System import bot_events_trigger, bot_events_recieved, bot_events_startup_check, bot_events_setup_check, BotEvents +botevents = BotEvents() from sopel_modules.SpiceBot_SBTools import bot_logging import time diff --git a/sopel_modules/SpiceBot_Events/System.py b/sopel_modules/SpiceBot_Events/System.py index 4b1fdd6..6058a5c 100644 --- a/sopel_modules/SpiceBot_Events/System.py +++ b/sopel_modules/SpiceBot_Events/System.py @@ -11,17 +11,6 @@ from sopel_modules.SpiceBot_SBTools import bot_logging from random import randint -def setup(bot): - bot_logging(bot, 'SpiceBot_Events', "Starting setup procedure") - bot_events_setup_check(bot) - bot_events_startup_register(bot, [botevents.BOT_WELCOME, botevents.BOT_READY, botevents.BOT_CONNECTED]) - - -def shutdown(bot): - if "SpiceBot_Events" in bot.memory: - del bot.memory["SpiceBot_Events"] - - class BotEvents(object): """An dynamic listing of all the notable Bot numeric events. @@ -54,6 +43,17 @@ class BotEvents(object): botevents = BotEvents() +def setup(bot): + bot_logging(bot, 'SpiceBot_Events', "Starting setup procedure") + bot_events_setup_check(bot) + bot_events_startup_register(bot, [botevents.BOT_WELCOME, botevents.BOT_READY, botevents.BOT_CONNECTED]) + + +def shutdown(bot): + if "SpiceBot_Events" in bot.memory: + del bot.memory["SpiceBot_Events"] + + def bot_events_trigger(bot, number, message): bot_events_setup_check(bot) diff --git a/sopel_modules/SpiceBot_InvalidCommand/InvalidCommand.py b/sopel_modules/SpiceBot_InvalidCommand/InvalidCommand.py index 41c5f69..71dc9ae 100644 --- a/sopel_modules/SpiceBot_InvalidCommand/InvalidCommand.py +++ b/sopel_modules/SpiceBot_InvalidCommand/InvalidCommand.py @@ -5,7 +5,8 @@ from __future__ import unicode_literals, absolute_import, division, print_functi import sopel.module from sopel_modules.SpiceBot_SBTools import sopel_triggerargs -from sopel_modules.SpiceBot_Events.System import bot_events_check, bot_events_recieved, botevents +from sopel_modules.SpiceBot_Events.System import bot_events_check, bot_events_recieved, BotEvents +botevents = BotEvents() def setup(bot): diff --git a/sopel_modules/SpiceBot_Logs/Logs.py b/sopel_modules/SpiceBot_Logs/Logs.py index 4be59f0..dc4584b 100644 --- a/sopel_modules/SpiceBot_Logs/Logs.py +++ b/sopel_modules/SpiceBot_Logs/Logs.py @@ -6,7 +6,8 @@ import sopel.module from sopel.config.types import StaticSection, ValidatedAttribute from sopel_modules.SpiceBot_SBTools import bot_logging -from sopel_modules.SpiceBot_Events.System import bot_events_startup_register, bot_events_recieved, bot_events_trigger, botevents +from sopel_modules.SpiceBot_Events.System import bot_events_startup_register, bot_events_recieved, bot_events_trigger, BotEvents +botevents = BotEvents() import os diff --git a/sopel_modules/SpiceBot_StartupMonologue/StartupMonologue_Display.py b/sopel_modules/SpiceBot_StartupMonologue/StartupMonologue_Display.py index 3761c5d..5ff6a7b 100644 --- a/sopel_modules/SpiceBot_StartupMonologue/StartupMonologue_Display.py +++ b/sopel_modules/SpiceBot_StartupMonologue/StartupMonologue_Display.py @@ -4,7 +4,8 @@ from __future__ import unicode_literals, absolute_import, division, print_functi import sopel.module -from sopel_modules.SpiceBot_Events.System import bot_events_recieved, bot_events_trigger, botevents +from sopel_modules.SpiceBot_Events.System import bot_events_recieved, bot_events_trigger, BotEvents +botevents = BotEvents() from sopel_modules.SpiceBot_SBTools import humanized_time, bot_logging import time