diff options
| author | 2020-01-30 16:31:38 +0000 | |
|---|---|---|
| committer | 2020-01-30 16:31:38 +0000 | |
| commit | 90c8805cb59089e78a98f6c0fcba793872f571cf (patch) | |
| tree | d8d3d5b7b0d99dcca90f07f6731807f82e496f7a | |
| parent | give messages.py a shorter _name (diff) | |
| signature | ||
allow !msearch to work in PM
| -rw-r--r-- | modules/messages.py | 7 |
1 files 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 !<pattern>string") + @utils.spec("!r~channel !<pattern>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: |
