Per script, ja! Nennt sich "Policy" oder "Plugin" und es gibt paar frameworks. Aber an sich ist das erstmal nichts anderes als ein program/befehl der einfach das Event auf STDIN bekommt: https://github.com/hoytech/strfry/blob/master/docs/plugins.md

Es gibt sowohl ein Framework in Deno von Alex Gleason als auch ein Go framework mit denen man die schreiben kann.

Aber die aller einfachste Variante ist im Grunde:

#!/bin/sh

input=$(cat)

if test "$(echo $input | wc -c)" = 0; then exit 1; fi

id=$(echo $input | jq -r ".event.id")

kind=$(echo $input | jq -r ".event.kind")

msg=$(echo $input | jq -r ".event.content")

rtmsg=""

if test $kind = 1; then

case $msg in

*badword*) rtmsg='{"id": "'$id'", "action": "shadowReject"}';;

esac

fi

echo $rtmsg

exit 0

Gibt bei weitem bessere Beispiele - aber das dient eher als Orientierung. :)

Ok. Das werd ich mir mal anschauen. Danke.

Reply to this note

Please Login to reply.

Discussion

No replies yet.