From 82b885dee07aa10a4ba5f9c589f1e2827f1d10ff Mon Sep 17 00:00:00 2001 From: Krille Date: Tue, 21 Nov 2023 08:22:34 +0100 Subject: [PATCH] feat: Add sendRaw command --- lib/src/utils/commands_extension.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/src/utils/commands_extension.dart b/lib/src/utils/commands_extension.dart index ab33df882..5e6f75417 100644 --- a/lib/src/utils/commands_extension.dart +++ b/lib/src/utils/commands_extension.dart @@ -17,6 +17,7 @@ */ import 'dart:async'; +import 'dart:convert'; import 'package:matrix/matrix.dart'; @@ -276,6 +277,14 @@ extension CommandsClientExtension on Client { txid: args.txid, ); }); + addCommand('sendRaw', (args) async { + await args.room.sendEvent( + jsonDecode(args.msg), + inReplyTo: args.inReplyTo, + txid: args.txid, + ); + return null; + }); } }