Improve command help and don't allow management commands if the AS bot is not in the room
This commit is contained in:
@@ -416,7 +416,8 @@ _**Telegram actions**: commands for using the bridge to interact with Telegram._
|
|||||||
The type is either `group`, `supergroup` or `channel` (defaults to `group`).
|
The type is either `group`, `supergroup` or `channel` (defaults to `group`).
|
||||||
**upgrade** - Upgrade a normal Telegram group to a supergroup.
|
**upgrade** - Upgrade a normal Telegram group to a supergroup.
|
||||||
**invitelink** - Get a Telegram invite link to the current chat.
|
**invitelink** - Get a Telegram invite link to the current chat.
|
||||||
**deleteportal** - Forget the current portal room.
|
**deleteportal** - Forget the current portal room. Only works for group chats; to delete a private
|
||||||
|
chat portal, simply leave the room.
|
||||||
"""
|
"""
|
||||||
return self.reply(management_status + help)
|
return self.reply(management_status + help)
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,12 @@ class MatrixHandler:
|
|||||||
if message["msgtype"] != "m.text":
|
if message["msgtype"] != "m.text":
|
||||||
return
|
return
|
||||||
|
|
||||||
is_management = len(self.az.intent.get_room_members(room)) == 2
|
try:
|
||||||
|
is_management = len(self.az.intent.get_room_members(room)) == 2
|
||||||
|
except MatrixRequestError:
|
||||||
|
# The AS bot is not in the room.
|
||||||
|
return
|
||||||
|
|
||||||
if is_command or is_management:
|
if is_command or is_management:
|
||||||
try:
|
try:
|
||||||
command, arguments = text.split(" ", 1)
|
command, arguments = text.split(" ", 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user