From 90c8805cb59089e78a98f6c0fcba793872f571cf Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 30 Jan 2020 16:31:38 +0000 Subject: [PATCH] allow !msearch to work in PM --- modules/messages.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/messages.py b/modules/messages.py index c5672d79..246d08b0 100644 --- a/modules/messages.py +++ b/modules/messages.py @@ -5,11 +5,10 @@ class Module(ModuleManager.BaseModule): _name = "MSG" @utils.hook("received.command.msearch") - @utils.spec("!-channelonly !string") + @utils.spec("!r~channel !string") def msearch(self, event): - print(event["spec"]) - pattern = re.compile(event["spec"][0], re.I) - message_list = list(event["target"].buffer.find_all(pattern)) + pattern = re.compile(event["spec"][1], re.I) + message_list = list(event["spec"][0].buffer.find_all(pattern)) message_count = len(message_list) if message_list: