~pmikkelsen/discordfront

f106bb31910229ffd86c5addd28ad6aa8ec258c9 — glenda 1 year, 10 days ago 7bf504d master
Support multi-line messages (incomming at least)
1 files changed, 18 insertions(+), 7 deletions(-)

M discordsrv
M discordsrv => discordsrv +18 -7
@@ 7,13 7,24 @@ discordfront $1 &

sleep 2

guild=''
chan=''
time=''
user=''
message=''

cat /srv/discordfront | while() { 
	msg=`'↑'{read}
	guild=$msg(1)
	chan=$msg(2)
	time=$msg(3)
	user=$msg(4)
	message=$msg(5)
	mkdir -p $home/lib/discord/logs/$guild
	echo -n $time $user → $message >> $home/lib/discord/logs/$guild/$chan
	if (! ~ $#msg 5) {
		echo -n '	' $"msg >> $home/lib/discord/logs/$guild/$chan
	}
	if not {
		guild=$msg(1)
		chan=$msg(2)
		time=$msg(3)
		user=$msg(4)
		message=$msg(5)
		mkdir -p $home/lib/discord/logs/$guild
		echo -n $time $user → $message >> $home/lib/discord/logs/$guild/$chan
	}
}