mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
te4sw
This commit is contained in:
parent
021e50a8db
commit
231e29f199
@ -16,7 +16,9 @@ class BotServer():
|
|||||||
"host": botconfig.core.host,
|
"host": botconfig.core.host,
|
||||||
}
|
}
|
||||||
self.isupport = {
|
self.isupport = {
|
||||||
"TARGMAX": {},
|
"TARGMAX": {
|
||||||
|
"KICK": 1,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
@ -24,6 +26,8 @@ class BotServer():
|
|||||||
"""We will try to find a dict value, or return None"""
|
"""We will try to find a dict value, or return None"""
|
||||||
if name.lower() in list(self.dict.keys()):
|
if name.lower() in list(self.dict.keys()):
|
||||||
return self.dict[str(name).lower()]
|
return self.dict[str(name).lower()]
|
||||||
|
elif name.lower() in list(self.isupport.keys()):
|
||||||
|
return self.dict[str(name).lower()]
|
||||||
else:
|
else:
|
||||||
raise Exception('Server dict does not contain a function or key ' + str(name.lower()))
|
raise Exception('Server dict does not contain a function or key ' + str(name.lower()))
|
||||||
|
|
||||||
@ -40,11 +44,18 @@ class BotServer():
|
|||||||
for param in parameters:
|
for param in parameters:
|
||||||
|
|
||||||
# check for value associated with the parameter
|
# check for value associated with the parameter
|
||||||
if '=' in param:
|
if '=' not in param:
|
||||||
|
self.isupport[param] = None
|
||||||
|
else:
|
||||||
key, raw_value = param.split('=')
|
key, raw_value = param.split('=')
|
||||||
|
|
||||||
# Only gather parameters that we want
|
if ',' not in raw_value:
|
||||||
if key in list(self.isupport.keys()):
|
self.isupport[key] = raw_value
|
||||||
|
else:
|
||||||
|
|
||||||
|
settings = str(raw_value).split(',')
|
||||||
|
for setting in settings:
|
||||||
|
settingname, setting_value = param.split('=')
|
||||||
|
|
||||||
if key.upper() == "TARGMAX":
|
if key.upper() == "TARGMAX":
|
||||||
|
|
||||||
|
|||||||
@ -30,4 +30,6 @@ def parse_event_005(bot, trigger):
|
|||||||
for setting in settings:
|
for setting in settings:
|
||||||
bot.osd([str(key), "includes", str(setting)], "#deathbybandaid")
|
bot.osd([str(key), "includes", str(setting)], "#deathbybandaid")
|
||||||
else:
|
else:
|
||||||
|
if not raw_value:
|
||||||
|
raw_value = None
|
||||||
bot.osd([str(key), "=", str(raw_value)], "#deathbybandaid")
|
bot.osd([str(key), "=", str(raw_value)], "#deathbybandaid")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user