diff --git a/mautrix_telegram/commands/telegram/misc.py b/mautrix_telegram/commands/telegram/misc.py index fe41cc12..06d66ebe 100644 --- a/mautrix_telegram/commands/telegram/misc.py +++ b/mautrix_telegram/commands/telegram/misc.py @@ -328,9 +328,11 @@ async def random(evt: CommandEvent) -> EventID: @command_handler(help_section=SECTION_PORTAL_MANAGEMENT, - help_args="<_number of messages_> [--takeout]", help_text="Backfill messages from Telegram history.") async def backfill(evt: CommandEvent) -> None: + if not evt.is_portal: + await evt.reply("You can only use backfill in portal rooms") + return portal = po.Portal.get_by_mxid(evt.room_id) try: await portal.backfill(evt.sender)