mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 22:49:53 -05:00
log host name
This commit is contained in:
parent
dfb3216cd1
commit
c133dadd91
@ -4,11 +4,24 @@ from __future__ import unicode_literals, absolute_import, division, print_functi
|
|||||||
This is the SpiceBot Server system.
|
This is the SpiceBot Server system.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from .Config import config as botconfig
|
||||||
|
|
||||||
|
|
||||||
class BotServer():
|
class BotServer():
|
||||||
"""This Logs all server values of relevance'"""
|
"""This Logs all server values of relevance'"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.dict = {}
|
self.dict = {
|
||||||
|
"host_connect": botconfig.core.host,
|
||||||
|
"host": botconfig.core.host,
|
||||||
|
}
|
||||||
|
|
||||||
|
def __getattr__(self, name):
|
||||||
|
''' will only get called for undefined attributes '''
|
||||||
|
"""We will try to find a dict value, or return None"""
|
||||||
|
if name.lower() in list(self.dict.keys()):
|
||||||
|
return self.dict[str(name).lower()]
|
||||||
|
else:
|
||||||
|
raise Exception('Server dict does not contain a function or key ' + str(name.lower()))
|
||||||
|
|
||||||
|
|
||||||
server = BotServer()
|
server = BotServer()
|
||||||
|
|||||||
@ -11,4 +11,5 @@ import sopel_modules.SpiceBot as SpiceBot
|
|||||||
@sopel.module.event(SpiceBot.events.RPL_WELCOME)
|
@sopel.module.event(SpiceBot.events.RPL_WELCOME)
|
||||||
@sopel.module.rule('.*')
|
@sopel.module.rule('.*')
|
||||||
def server_name(bot, trigger):
|
def server_name(bot, trigger):
|
||||||
bot.say(str(trigger.sender), "deathbybandaid")
|
SpiceBot.server.dict["host"] = str(trigger.sender).lower()
|
||||||
|
bot.say(str(SpiceBot.server.host), "deathbybandaid")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user