-PAGER=/dev/tty scoop -d "$db" -p "$channel" -D "$time" -F "%Y-%m-%d %H:%M:%S" \
- | awk '{$1=""; print substr($0, 2, length($0) - 1)}'
+
+if grep -qx "$channel" /etc/scoop-cgi/channels; then
+ db=$(cat /etc/scoop-cgi/database)
+ PAGER=/dev/tty scoop -d "$db" -p "$channel" -D "$time" \
+ -F "%Y-%m-%d %H:%M:%S" \
+ | awk '{$1=""; print substr($0, 2, length($0) - 1)}'
+elif grep -qx "$channel" /etc/scoop-cgi/logbot; then
+ awk -v date="$time" 'substr($1, 0, 11) == date {outp = substr($1, 12);
+for (i = 3; i <= NF; i++) outp = outp " " $i; print outp}' \
+ "/srv/www/scoop-cgi/$channel"
+fi