From 9f8ed09a5c194ee560d4980e89dc8f9dcb52878c Mon Sep 17 00:00:00 2001 From: Adrien Abraham Date: Sun, 26 Nov 2023 01:17:04 +0100 Subject: [PATCH] notes: case insensitive nicks for delivery --- edmond/plugins/notes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/edmond/plugins/notes.py b/edmond/plugins/notes.py index 517bfca..b7a6e3a 100644 --- a/edmond/plugins/notes.py +++ b/edmond/plugins/notes.py @@ -1,4 +1,5 @@ import re +import time from edmond.plugin import Plugin @@ -71,7 +72,9 @@ class NotesPlugin(Plugin): def deliver_notes(self, target, nick): """Deliver all notes for this user in the target channel/user.""" notes = self.get_storage_value("notes", []) - notes = list(filter(lambda n: n["dest"] == nick, notes)) + notes = list(filter( + lambda n: n["dest"].lower() == nick.lower(), notes + )) self.bot.log_d(f"Delivering {len(notes)} notes to {nick}.") for note in notes: message = self.config["deliver_format"].format( @@ -81,6 +84,7 @@ class NotesPlugin(Plugin): ) self.bot.say(target, message) self.remove_storage_list_value("notes", note) + time.sleep(0.7) def count_user_notes(self, nick): """Count the number of undelivered notes this user has."""