Skip to content

Commit 9019dfd

Browse files
authored
Merge pull request #1618 from famedly/krille/add-raw-command
feat: Add sendRaw command
2 parents c6e8b16 + 82b885d commit 9019dfd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/src/utils/commands_extension.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
import 'dart:async';
20+
import 'dart:convert';
2021

2122
import 'package:matrix/matrix.dart';
2223

@@ -276,6 +277,14 @@ extension CommandsClientExtension on Client {
276277
txid: args.txid,
277278
);
278279
});
280+
addCommand('sendRaw', (args) async {
281+
await args.room.sendEvent(
282+
jsonDecode(args.msg),
283+
inReplyTo: args.inReplyTo,
284+
txid: args.txid,
285+
);
286+
return null;
287+
});
279288
}
280289
}
281290

0 commit comments

Comments
 (0)