summaryrefslogtreecommitdiff
path: root/lib/Matrix/Client.pm6
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2019-06-17 23:58:29 -0300
committerMatias Linares <matiaslina@gmail.com>2019-06-17 23:58:29 -0300
commit989e6afb0b9c4b43cac48918ee08d0e24c606c80 (patch)
tree7d68e08322813ec2595760c8d6554fd8f5304429 /lib/Matrix/Client.pm6
parentc5e5856fab53af27e085bb65ba9eeacd2def1e6e (diff)
downloadperl6-matrix-client-989e6afb0b9c4b43cac48918ee08d0e24c606c80.tar.gz
Add ban and unban endpoints
Diffstat (limited to 'lib/Matrix/Client.pm6')
-rw-r--r--lib/Matrix/Client.pm617
1 files changed, 17 insertions, 0 deletions
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");