beter instance handling

This commit is contained in:
deathbybandaid 2019-05-14 16:14:59 -04:00
parent 2cf80a320f
commit ce5ed8e536
9 changed files with 20 additions and 27 deletions

View File

@ -7,8 +7,7 @@ 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
botevents = BotEvents()
from sopel_modules.SpiceBot_Events.System import bot_events_check, botevents
@sopel.module.nickname_commands('(.*)')

View File

@ -6,13 +6,12 @@ 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
from sopel_modules.SpiceBot_SBTools import (
join_all_channels, chanadmin_all_channels, channel_list_current,
bot_logging
)
botevents = BotEvents()
import spicemanip

View File

@ -6,13 +6,12 @@ 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
from sopel_modules.SpiceBot_SBTools import (
sopel_triggerargs, inlist, channel_privs,
join_all_channels, channel_list_current,
)
from .Channels import bot_part_empty
botevents = BotEvents()
@sopel.module.nickname_commands('channels', 'channel')

View File

@ -7,9 +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
from sopel_modules.SpiceBot_SBTools import bot_logging
botevents = BotEvents()
import spicemanip

View File

@ -5,9 +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
from sopel_modules.SpiceBot_SBTools import bot_logging
botevents = BotEvents()
import time

View File

@ -11,6 +11,17 @@ 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.
@ -40,17 +51,6 @@ 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)

View File

@ -5,8 +5,7 @@ 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
botevents = BotEvents()
from sopel_modules.SpiceBot_Events.System import bot_events_check, bot_events_recieved, botevents
def setup(bot):

View File

@ -6,8 +6,7 @@ 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
botevents = BotEvents()
from sopel_modules.SpiceBot_Events.System import bot_events_startup_register, bot_events_recieved, bot_events_trigger, botevents
import os

View File

@ -4,9 +4,9 @@ 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
from sopel_modules.SpiceBot_SBTools import humanized_time, bot_logging
botevents = BotEvents()
import time