From bad47e346ec68cde8a5f32229c0c45ddd1da31d4 Mon Sep 17 00:00:00 2001 From: iou1name Date: Fri, 25 May 2018 07:22:56 -0400 Subject: [PATCH] made in-memory seendb case insensitive --- modules/seen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/seen.py b/modules/seen.py index 6f34259..7e1ea79 100755 --- a/modules/seen.py +++ b/modules/seen.py @@ -8,6 +8,8 @@ import threading from datetime import datetime from sqlite3 import OperationalError +from requests.structures import CaseInsensitiveDict + from tools.time import relativeTime from module import commands, example, hook, require_chanmsg @@ -17,11 +19,11 @@ def load_database(bot): Loads all entries from the 'seen' table in the bot's database and returns them. """ - data = {} + data = CaseInsensitiveDict() seens = bot.db.execute("SELECT * FROM seen").fetchall() for seen in seens: - nick, seen = seen[0], seen[1:] + nick, seen = seen[0].lower(), seen[1:] data[nick] = seen return data