dm support
This commit is contained in:
parent
f19f7e8511
commit
55b78ea09e
3 changed files with 103 additions and 22 deletions
|
|
@ -51,16 +51,16 @@ class DemoBot(SMALBot):
|
|||
return
|
||||
|
||||
if msg["content"]["body"].startswith("!echo"):
|
||||
logger.error(f"reply to this: {msg}")
|
||||
|
||||
txt = msg["content"]["body"][5:].strip()
|
||||
|
||||
if txt.strip() == "":
|
||||
txt = "Are you kidding me?"
|
||||
|
||||
# self.sendmessage(msg["roomid"], txt)
|
||||
self.sendmessagereply(msg["roomid"], msg["id"], msg["sender"], txt)
|
||||
if txt == "":
|
||||
txt = "Empty text? Are you kidding me?"
|
||||
|
||||
if msg["is_direct"]:
|
||||
self.sendmessage(msg["roomid"], txt)
|
||||
else:
|
||||
self.sendmessagereply(msg["roomid"], msg["id"], msg["sender"], txt)
|
||||
return
|
||||
|
||||
logger.info(f"ignored a message: {msg}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue