mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
29 lines
993 B
Python
29 lines
993 B
Python
# coding=utf8
|
|
from __future__ import unicode_literals, absolute_import, division, print_function
|
|
"""
|
|
This is the SpiceBot OSD system.
|
|
"""
|
|
import sopel
|
|
|
|
|
|
@sopel.module.event('005')
|
|
@sopel.module.rule('.*')
|
|
def parse_event_005(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)
|