Reduce data variables

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2024-10-06 17:21:10 +02:00
parent 58f1e22dde
commit 2b0207d12b
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57

View File

@ -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"])