Skip to content

Commit

Permalink
parse markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
maltee1 committed May 1, 2023
1 parent 9aa9ce5 commit 453a691
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mautrix_telegram/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
UserID,
VideoInfo,
)
from mautrix.util import background_task, magic, variation_selector
from mautrix.util import background_task, magic, markdown, variation_selector
from mautrix.util.format_duration import format_duration
from mautrix.util.message_send_checkpoint import MessageSendCheckpointStatus
from mautrix.util.simple_lock import SimpleLock
Expand Down Expand Up @@ -566,11 +566,14 @@ async def create_telegram_chat(self, source: u.User, supergroup: bool = False) -
)
if len(errors) > 0:
error_list = "\n".join(f"* [{mxid}](https://matrix.to/#/{mxid})" for mxid in errors)
command_prefix = self.config["bridge.command_prefix"]
await self.az.intent.send_notice(
self.mxid,
f"Failed to add the following users to the chat:\n\n{error_list}\n\n"
"You can try `$cmdprefix+sp search -r <username>` to help the bridge find "
"those users.",
markdown.render(
f"Failed to add the following users to the chat:\n\n{error_list}\n\n"
f"You can try `{command_prefix} search -r <username>` to help the bridge find "
"those users."
),
)
elif self.tgid:
raise ValueError("Can't create Telegram chat for portal with existing Telegram chat.")
Expand Down

0 comments on commit 453a691

Please sign in to comment.