diff --git a/mautrix_telegram/example-config.yaml b/mautrix_telegram/example-config.yaml index 7b429210..028cce7f 100644 --- a/mautrix_telegram/example-config.yaml +++ b/mautrix_telegram/example-config.yaml @@ -394,6 +394,21 @@ bridge: # The prefix for commands. Only required in non-management rooms. command_prefix: "!tg" + # Messages sent upon joining a management room. + # Markdown is supported. The defaults are listed below. + management_room_text: + # Sent when joining a room. + welcome: "Hello, I'm a Telegram bridge bot." + # Sent when joining a management room and the user is already logged in. + welcome_connected: "Use `help` for help." + # Sent when joining a management room and the user is not logged in. + welcome_unconnected: "Use `help` for help or `login` to log in." + # Optional extra text sent when joining a management room. + additional_help: "" + + # Send each message separately (for readability in some clients) + management_room_multiple_messages: false + # Permissions for using the bridge. # Permitted values: # relaybot - Only use the bridge via the relaybot, no access to commands. diff --git a/mautrix_telegram/matrix.py b/mautrix_telegram/matrix.py index 2813c988..be177ef4 100644 --- a/mautrix_telegram/matrix.py +++ b/mautrix_telegram/matrix.py @@ -115,23 +115,6 @@ async def handle_puppet_invite(self, room_id: RoomID, puppet: pu.Puppet, inviter await intent.send_notice(room_id, "This puppet will remain inactive until a " "Telegram chat is created for this room.") - async def send_welcome_message(self, room_id: RoomID, inviter: 'u.User') -> None: - try: - is_management = len(await self.az.intent.get_room_members(room_id)) == 2 - except MatrixError: - # The AS bot is not in the room. - return - cmd_prefix = self.commands.command_prefix - text = html = "Hello, I'm a Telegram bridge bot. " - if is_management and inviter.puppet_whitelisted and not await inviter.is_logged_in(): - text += f"Use `{cmd_prefix} help` for help or `{cmd_prefix} login` to log in." - html += (f"Use {cmd_prefix} help for help" - f" or {cmd_prefix} login to log in.") - else: - text += f"Use `{cmd_prefix} help` for help." - html += f"Use {cmd_prefix} help for help." - await self.az.intent.send_notice(room_id, text=text, html=html) - async def handle_invite(self, room_id: RoomID, user_id: UserID, inviter: 'u.User', event_id: EventID) -> None: user = u.User.get_by_mxid(user_id, create=False)