From 16effab79e4d0895efd6e7c22f015497642f00b5 Mon Sep 17 00:00:00 2001 From: Jin-Guk Kwon Date: Thu, 31 Dec 2020 10:22:19 +0100 Subject: [PATCH] [tools]Add new file for matrix --- matrix/invite_rooms | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 matrix/invite_rooms diff --git a/matrix/invite_rooms b/matrix/invite_rooms new file mode 100644 index 0000000..8170d04 --- /dev/null +++ b/matrix/invite_rooms @@ -0,0 +1,35 @@ +matrixserver="" + +generate_post_data() +{ + cat </invite?access_token=") + echo $res + #avoid error { "errcode": "M_LIMIT_EXCEEDED", "error": "Too Many Requests", "retry_after_ms": 2895 } + if [[ $res =~ $errcode ]];then + sleep 5 + res2=$(curl -XPOST -d "$(generate_post_data)" "http://localhost:8008/_matrix/client/r0/rooms/%21$rm_id%3A/invite?access_token=") + fi + + if [[ $res2 =~ $errcode ]];then + echo "===error===" + echo $res2 + exit 1 + fi + sleep 1 + done < info.txt +done \ No newline at end of file