SpiceBot-migrated/sopel_modules/SpiceBot_Core_Processing/Server.py
2019-07-04 09:02:43 -04:00

30 lines
889 B
Python

# coding=utf8
from __future__ import unicode_literals, absolute_import, division, print_function
"""
This is the SpiceBot Channels system.
"""
import sopel
import sopel_modules.SpiceBot as SpiceBot
@sopel.module.event(SpiceBot.events.RPL_WELCOME)
@sopel.module.rule('.*')
def server_name(bot, trigger):
SpiceBot.server.rpl_welcome(trigger)
@sopel.module.event(SpiceBot.events.RPL_ISUPPORT)
@sopel.module.rule('.*')
def parse_event_005(bot, trigger):
# SpiceBot.server.parse_reply_isupport(trigger)
if trigger.args[-1] != 'are supported by this server':
return
SpiceBot.server.linenumber += 1
parameters = trigger.args[1:-1]
for param in parameters:
if '=' in param:
paramname = str(param).split('=')[0]
paramvalue = str(param).split('=')[1]
bot.osd([str(paramname), "=", str(paramvalue)], "#deathbybandaid")