SpiceBot-migrated/sopel_modules/SpiceBot_LoadOrder/Connected.py

26 lines
639 B
Python

# coding=utf-8
from __future__ import unicode_literals, absolute_import, division, print_function
import sopel.module
from .LoadOrder import check_bot_events, startup_bot_event, set_bot_event
from sopel_modules.SpiceBot_SBTools import bot_logging
import time
@sopel.module.event('001')
@sopel.module.rule('.*')
def bot_startup_connection(bot, trigger):
if check_bot_events(bot, ["startup_complete"]):
return
startup_bot_event(bot, "connected")
while not len(bot.channels.keys()) > 0:
pass
time.sleep(1)
set_bot_event(bot, "connected")
bot_logging(bot, 'Sopel_LoadOrder', "Connected to IRC")