Add support for /command@bot bot command syntax

This commit is contained in:
Tulir Asokan
2018-02-24 12:57:18 +02:00
parent 8a7ccc0007
commit 55046e15b2
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -127,9 +127,9 @@ class Bot(AbstractUser):
text = message.message
portal = po.Portal.get_by_entity(message.to_id)
if text == "/portal":
if text == "/portal" or text == f"/portal@{self.username}":
await self.handle_command_portal(portal, reply)
elif text.startswith("/invite"):
elif text.startswith("/invite") or text.startswith(f"/invite@{self.username}"):
await self.handle_command_invite(portal, reply, mxid=text[len("/invite "):])
async def update(self, update):