From 989e6afb0b9c4b43cac48918ee08d0e24c606c80 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Mon, 17 Jun 2019 23:58:29 -0300 Subject: Add ban and unban endpoints --- lib/Matrix/Client.pm6 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/Matrix') diff --git a/lib/Matrix/Client.pm6 b/lib/Matrix/Client.pm6 index 2fdbf4b..a19918b 100644 --- a/lib/Matrix/Client.pm6 +++ b/lib/Matrix/Client.pm6 @@ -202,6 +202,23 @@ method join-room($room-id!) { $.post("/join/$room-id") } +#| POST - /_matrix/client/r0/rooms/{roomId}/ban +method ban(Str $room-id, Str $user-id, $reason = "") { + $.post( + "/rooms/$room-id/ban", + :$user-id, + :$reason + ); +} + +#| POST - /_matrix/client/r0/rooms/{roomId}/unban +method unban(Str $room-id, Str $user-id) { + $.post( + "/rooms/$room-id/unban", + :$user-id + ); +} + #| POST - /_matrix/client/r0/rooms/{roomId}/leave method leave-room($room-id) { $.post("/rooms/$room-id/leave"); -- cgit v1.2.3-70-g09d2