Avoid catchall DirectAsk
This commit is contained in:
parent
7ae7e381c3
commit
e83c4091bf
2 changed files with 65 additions and 55 deletions
|
|
@ -72,9 +72,11 @@ class Bot(threading.Thread):
|
|||
|
||||
import re
|
||||
def in_ping(msg):
|
||||
if re.match("^ *(m[' ]?entends?[ -]+tu|h?ear me|do you copy|ping)", msg.message, re.I) is not None:
|
||||
return msg.respond("pong")
|
||||
self.treater.hm.add_hook(nemubot.hooks.Message(in_ping), "in", "DirectAsk")
|
||||
return msg.respond("pong")
|
||||
self.treater.hm.add_hook(nemubot.hooks.Message(in_ping,
|
||||
match=lambda msg: re.match("^ *(m[' ]?entends?[ -]+tu|h?ear me|do you copy|ping)",
|
||||
msg.message, re.I)),
|
||||
"in", "DirectAsk")
|
||||
|
||||
def in_echo(msg):
|
||||
from nemubot.message import Text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue