|
|
|
@ -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."""
|
|
|
|
|