mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
test
This commit is contained in:
parent
73101943d2
commit
4642d784e4
@ -8,9 +8,17 @@ import sopel
|
|||||||
import sopel_modules.SpiceBot as SpiceBot
|
import sopel_modules.SpiceBot as SpiceBot
|
||||||
|
|
||||||
|
|
||||||
@sopel.module.event(SpiceBot.events.BOT_WELCOME)
|
@sopel.module.event(SpiceBot.events.RPL_WELCOME)
|
||||||
@sopel.module.rule('.*')
|
@sopel.module.rule('.*')
|
||||||
def bot_events_connected(bot, trigger):
|
def bot_events_connected(bot, trigger):
|
||||||
|
|
||||||
|
# Handling for connection count
|
||||||
|
SpiceBot.events.dict["RPL_WELCOME_Count"] += 1
|
||||||
|
if SpiceBot.events.dict["RPL_WELCOME_Count"] > 1:
|
||||||
|
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_RECONNECTED, "Bot ReConnected to IRC")
|
||||||
|
else:
|
||||||
|
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_WELCOME, "Welcome to the SpiceBot Events System")
|
||||||
|
|
||||||
"""For items tossed in a queue, this will trigger them accordingly"""
|
"""For items tossed in a queue, this will trigger them accordingly"""
|
||||||
while True:
|
while True:
|
||||||
if len(SpiceBot.events.dict["trigger_queue"]):
|
if len(SpiceBot.events.dict["trigger_queue"]):
|
||||||
@ -19,26 +27,12 @@ def bot_events_connected(bot, trigger):
|
|||||||
del SpiceBot.events.dict["trigger_queue"][0]
|
del SpiceBot.events.dict["trigger_queue"][0]
|
||||||
|
|
||||||
|
|
||||||
@sopel.module.event(SpiceBot.events.RPL_WELCOME)
|
|
||||||
@sopel.module.rule('.*')
|
|
||||||
def bot_startup_welcome(bot, trigger):
|
|
||||||
"""The Bot events system does not start until RPL_WELCOME 001 is recieved
|
|
||||||
from the server"""
|
|
||||||
if SpiceBot.events.check(SpiceBot.events.BOT_WELCOME):
|
|
||||||
return
|
|
||||||
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_WELCOME, "Welcome to the SpiceBot Events System")
|
|
||||||
|
|
||||||
|
|
||||||
@sopel.module.event(SpiceBot.events.BOT_WELCOME)
|
@sopel.module.event(SpiceBot.events.BOT_WELCOME)
|
||||||
@sopel.module.rule('.*')
|
@sopel.module.rule('.*')
|
||||||
def bot_events_start(bot, trigger):
|
def bot_events_start(bot, trigger):
|
||||||
"""This stage is redundant, but shows the system is working."""
|
"""This stage is redundant, but shows the system is working."""
|
||||||
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_READY, "Ready To Process module setup procedures")
|
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_READY, "Ready To Process module setup procedures")
|
||||||
|
|
||||||
|
|
||||||
@sopel.module.event(SpiceBot.events.BOT_WELCOME)
|
|
||||||
@sopel.module.rule('.*')
|
|
||||||
def bot_events_Connected(bot, trigger):
|
|
||||||
"""Here, we wait until we are in at least one channel"""
|
"""Here, we wait until we are in at least one channel"""
|
||||||
while not len(bot.channels.keys()) > 0:
|
while not len(bot.channels.keys()) > 0:
|
||||||
pass
|
pass
|
||||||
@ -51,11 +45,3 @@ def bot_events_Connected(bot, trigger):
|
|||||||
def bot_events_startup_complete(bot, trigger):
|
def bot_events_startup_complete(bot, trigger):
|
||||||
"""All events registered as required for startup have completed"""
|
"""All events registered as required for startup have completed"""
|
||||||
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_LOADED, "All registered modules setup procedures have completed")
|
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_LOADED, "All registered modules setup procedures have completed")
|
||||||
|
|
||||||
|
|
||||||
@sopel.module.event(SpiceBot.events.RPL_WELCOME)
|
|
||||||
@sopel.module.rule('.*')
|
|
||||||
def bot_startup_reconnect(bot, trigger):
|
|
||||||
SpiceBot.events.dict["RPL_WELCOME_Count"] += 1
|
|
||||||
if SpiceBot.events.dict["RPL_WELCOME_Count"] > 1:
|
|
||||||
SpiceBot.events.trigger(bot, SpiceBot.events.BOT_RECONNECTED, "Bot ReConnected to IRC")
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user