allow !msearch to work in PM

This commit is contained in:
jesopo 2020-01-30 16:31:38 +00:00
parent 2a950b6c5b
commit 90c8805cb5

View file

@ -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: