mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-11 14:10:58 -05:00
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
# coding=utf8
|
|
from __future__ import unicode_literals, absolute_import, division, print_function
|
|
"""
|
|
This is the SpiceBot OSD system.
|
|
"""
|
|
import sopel
|
|
|
|
import sopel_modules.SpiceBot as SpiceBot
|
|
|
|
|
|
@sopel.module.event(SpiceBot.events.RPL_ISUPPORT)
|
|
@sopel.module.rule('.*')
|
|
def parse_event_005_kick(bot, trigger):
|
|
if trigger.args[-1] != 'are supported by this server':
|
|
return
|
|
parameters = trigger.args[1:-1]
|
|
for param in parameters:
|
|
if '=' in param:
|
|
if param.startswith("TARGMAX"):
|
|
param = str(param).split('=')[1]
|
|
settings = str(param).split(',')
|
|
for setting in settings:
|
|
settingname = str(setting).split(':')[0]
|
|
if settingname.upper() in ['KICK']:
|
|
try:
|
|
value = str(setting).split(':')[1] or None
|
|
except IndexError:
|
|
value = None
|
|
if value:
|
|
bot.config.SpiceBot_Kick.kick = int(value)
|