summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2024-10-06 17:21:10 +0200
committerGeorg Pfuetzenreuter2024-10-06 17:22:20 +0200
commit2b0207d12bdd72d37069bcdbb65f474d0d52535f (patch)
tree032dc3e8bf21e07223c11e218efaf0626a41f2de
parent58f1e22dde319e92f32611fc3fd5c22f7b428471 (diff)
downloadsnoparser-2b0207d12bdd72d37069bcdbb65f474d0d52535f.tar.gz
snoparser-2b0207d12bdd72d37069bcdbb65f474d0d52535f.tar.bz2
snoparser-2b0207d12bdd72d37069bcdbb65f474d0d52535f.zip
Reduce data variables
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
-rw-r--r--plugin.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugin.py b/plugin.py
index e0f6771..de93e94 100644
--- a/plugin.py
+++ b/plugin.py
@@ -212,13 +212,15 @@ class SnoParser(callbacks.Plugin):
Queries the cache for an address.
"""
- data = self.redis_clients['whois'].get(sourceip)
- decoded_data = data.decode("utf-8")
+ data = self.redis_clients['whois'].get(ipaddress)
+ if data is not None:
+ data = data.decode("utf-8")
ttl = self.redis_clients['whois'].ttl(ipaddress)
count = self.redis_clients['ips'].get(ipaddress)
- decoded_count = count.decode("utf-8")
+ if count is not None:
+ count = count.decode("utf-8")
print("SnoParser manual query: ", data, " ", ttl)
- irc.reply(f"{decoded_data} - Count: {decoded_count} - Remaining: {ttl}s")
+ irc.reply(f"{data} - Count: {count} - Remaining: {ttl}s")
ipquery = wrap(ipquery, ["ip"])