aboutsummaryrefslogtreecommitdiffstats
path: root/reaktor/commands/tell-on_privmsg
diff options
context:
space:
mode:
Diffstat (limited to 'reaktor/commands/tell-on_privmsg')
-rwxr-xr-xreaktor/commands/tell-on_privmsg13
1 files changed, 7 insertions, 6 deletions
diff --git a/reaktor/commands/tell-on_privmsg b/reaktor/commands/tell-on_privmsg
index 73163fa..9206d8c 100755
--- a/reaktor/commands/tell-on_privmsg
+++ b/reaktor/commands/tell-on_privmsg
@@ -6,12 +6,13 @@ if test "${FLOCK-}" != "$state_file"; then
exec env FLOCK="$state_file" flock "$state_file" "$0" "$@"
fi
-from="$_prefix"
-to=${1%% *}
-msg=${1#* }
-date=$(date)
-
# TODO tell now, if already joined
-printf '%s %s <%s> %s\n' "$to" "$from" "$date" "$msg" >> "$state_file"
+jq -cn \
+ --arg from "$_from" \
+ --arg to "${1%% *}" \
+ --arg text "${1##* }" \
+ --arg msgtarget "$_msgtarget" \
+ '{ $from, $to, $text, $msgtarget, date: (now | todate) }' \
+ >> "$state_file"
echo 'Consider it noted.' # that's what lambdabot says...