added helper functions to IRCBot to utilise the new bot settings table.
This commit is contained in:
parent
052e741da0
commit
98718546cf
1 changed files with 10 additions and 0 deletions
10
IRCBot.py
10
IRCBot.py
|
@ -77,6 +77,16 @@ class Bot(object):
|
||||||
self.servers[server.fileno()] = server
|
self.servers[server.fileno()] = server
|
||||||
else:
|
else:
|
||||||
timer.redo()
|
timer.redo()
|
||||||
|
|
||||||
|
def set_setting(self, setting, value):
|
||||||
|
self.database.set_bot_setting(setting, value)
|
||||||
|
def get_setting(self, setting, default=None):
|
||||||
|
return self.database.get_bot_setting(setting, default)
|
||||||
|
def find_settings(self, pattern, default=[]):
|
||||||
|
return self.database.find_bot_settings(pattern, default)
|
||||||
|
def del_setting(self, setting):
|
||||||
|
self.database.del_bot_setting(setting)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
while self.running:
|
while self.running:
|
||||||
self.lock.acquire()
|
self.lock.acquire()
|
||||||
|
|
Loading…
Reference in a new issue