diff --git a/matrix.sh b/matrix.sh index 5a6e1b2..2512f82 100755 --- a/matrix.sh +++ b/matrix.sh @@ -34,6 +34,7 @@ help() { echo " --token= Access token to use. Only useful if you don't want to use --login." echo " --homeserver= Homeserver address to use. Only useful if you don't want to use --login. Must start with \"https\". Must not have a trailing slash." echo " --room= Which room to send the message to." + echo " --notice Send a notice instead of a message." echo " --html Enable HTML tags in message." echo " --pre Wraps the given message into
 and escapes all other HTML special chars."
 	echo "  --file=              Send  to the room."
@@ -221,7 +222,7 @@ send_message() {
 	if $HTML; then
 		clean_body="${text//<+([a-zA-Z0-9\"\'= \/])>/}"
 		clean_body=`escape "$clean_body"`
-		data="{\"body\": $clean_body, \"msgtype\":\"m.text\",\"formatted_body\":$text,\"format\":\"org.matrix.custom.html\"}"
+		data="{\"body\": $clean_body, \"msgtype\":\"$MESSAGE_TYPE\",\"formatted_body\":$text,\"format\":\"org.matrix.custom.html\"}"
 	else
 		data="{\"body\": $text, \"msgtype\":\"m.text\"}"
 	fi
@@ -283,6 +284,10 @@ for i in "$@"; do
 			PRE="true"
 			shift
 			;;
+		--notice)
+			MESSAGE_TYPE="m.notice"
+			shift
+			;;
 		--file=*)
 			FILE="${i#*=}"
 			ACTION="send"