Added the option to !opt-in/opt-out [onlinebot only]

Fixed command & event threading
Events are now threaded by event_type (i.e. all buddy_logon events get ran in the same one)
Added default preferences
Fixed recipe loading for multiple installs (i.e. on different machines)
This commit is contained in:
2021-08-27 13:58:47 +02:00
parent d0c8c1744c
commit c04f76c0db
24 changed files with 258 additions and 122 deletions
+3 -4
View File
@@ -75,13 +75,12 @@ class DB:
if string.__contains__("UPDATE ") or string.__contains__("INSERT "):
conn.commit()
except Exception as e:
raise SqlException("SQL Error: '%s' for '%s' [%s]" % (
str(e), sql, ", ".join(map(lambda x: str(x), params)))) from e
raise SqlException( f"SQL Error: '{str(e)}' for '{sql}' "
f"[{', '.join(map(lambda x: str(x), params))}]") from e
elapsed = time.time() - start_time
result = callback(cur)
if elapsed > 5:
self.logger.warning("slow query (%fs) '%s' for params: %s" % (elapsed, sql, str(params)))
self.logger.warning(f"slow query ({elapsed:f}s) '{sql}' for params: {str(params)}")
return result
def query_single(self, sql, params=None, extended_like=False) -> DictObject: