From cdddf8fd65bd7c52108ed24d109db9a9f1e3ebd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Tue, 25 May 2021 23:19:08 +0300 Subject: [PATCH] Fix bytestrings not getting decoded to strings when modifying trusted list --- o2_botcmd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/o2_botcmd.py b/o2_botcmd.py index 110e559..0367cea 100644 --- a/o2_botcmd.py +++ b/o2_botcmd.py @@ -99,6 +99,9 @@ loadmessages() def addtrusted(chan, account): global trusted, trustedlock + + if type(chan) != str: chan = chan.decode() + if type(account) != str: account = account.decode() trustedlock.acquire() @@ -113,6 +116,9 @@ def addtrusted(chan, account): def rmtrusted(chan, account): global trusted, trustedlock + if type(chan) != str: chan = chan.decode() + if type(account) != str: account = account.decode() + trustedlock.acquire() if chan in trusted and account in trusted[chan]: