From 5777ef0cfe3921bca6171f35b378fa611d36c12f Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 13 Oct 2019 12:38:44 +0100 Subject: [PATCH] Improve ZNC error message detection --- core/bot.py | 7 +++---- main.py | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/bot.py b/core/bot.py index fe46749..74e52f2 100644 --- a/core/bot.py +++ b/core/bot.py @@ -68,10 +68,9 @@ class IRCRelay(IRCClient): def privmsg(self, user, channel, msg): nick, ident, host = self.parsen(user) - if "does not exist" in msg or "doesn't exist" in msg: - error("ZNC issue:", msg) - if "Unable to load" in msg: - error("ZNC issue:", msg) + for i in main.ZNCErrors: + if i in msg: + error("ZNC issue:", msg) if nick[0] == main.config["Tweaks"]["ZNC"]["Prefix"]: nick = nick[1:] if nick in self.relayCommands.keys(): diff --git a/main.py b/main.py index 1e2a767..bba9753 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,11 @@ from os import urandom from utils.logging.log import * +ZNCErrors = ["Error:", + "Unable to load", + "does not exist", + "doesn't exist"] + configPath = "conf/" certPath = "cert/"