From 98718546cf0882abd40102dbb7c9345a1b65e022 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 14 Apr 2016 16:48:17 +0100 Subject: [PATCH] added helper functions to IRCBot to utilise the new bot settings table. --- IRCBot.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/IRCBot.py b/IRCBot.py index d031c9f9..6fffea7f 100644 --- a/IRCBot.py +++ b/IRCBot.py @@ -77,6 +77,16 @@ class Bot(object): self.servers[server.fileno()] = server else: 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): while self.running: self.lock.acquire()