From 259fdb20906934cfac44c54d303e14ba68b43c16 Mon Sep 17 00:00:00 2001 From: Krille Date: Mon, 24 Feb 2025 10:52:27 +0100 Subject: [PATCH] feat: Add command to upgrade room --- lib/src/utils/commands_extension.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/src/utils/commands_extension.dart b/lib/src/utils/commands_extension.dart index ebfd6bb6..89724ef6 100644 --- a/lib/src/utils/commands_extension.dart +++ b/lib/src/utils/commands_extension.dart @@ -460,6 +460,16 @@ extension CommandsClientExtension on Client { stdout?.write(DefaultCommandOutput(users: [mxid]).toString()); return null; }); + addCommand('roomupgrade', (args, stdout) async { + final version = args.msg; + if (version.isEmpty) { + throw CommandException('Please provide a room version'); + } + final newRoomId = + await args.room!.client.upgradeRoom(args.room!.id, version); + stdout?.write(DefaultCommandOutput(rooms: [newRoomId]).toString()); + return null; + }); } }