Last active
June 8, 2020 20:03
-
-
Save lovelaced/c63eea57ae87287768e73159db97ed51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Adjust homserver, room, and accesstoken to your particular setup | |
msgtype=m.text | |
homeserver="$2" | |
room="$3" | |
accesstoken="$4" | |
while true; do | |
rand=$(( ( RANDOM % 10 ) + 1 )) | |
echo "Sleeping $rand seconds..." | |
sleep $rand | |
echo "Sending message to server..." | |
echo "huh??" | curl -XPOST -d "$( jq -Rs --arg msgtype "$msgtype" '{$msgtype, body:., "m.labels": [ "#bot" ]}')" "https://$homeserver/_matrix/client/r0/rooms/%21$room:$homeserver/send/m.room.message?access_token=$accesstoken" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment