#!/bin/bash -f ###################################################################### # Discord Puppy Bot Poll, (C) 2015-2019 Nosey Nick Waterman, # https://noseynick.org/artemis/ # All wrong righted, all rights reserved. Licensed under thev GNU # Affero General Public License v3.0 https://www.gnu.org/licenses/agpl.txt # with Commons Clause https://commonsclause.com/ v1.0 ###################################################################### cd ${0%/*} # approx "dirname" - to find ./discord.sh NL=" " LETTERS=$(echo a{6..9} a{a..f} b{0..9} b{a..f}) echo "# Enter poll title/description (1 line):" echo -n "> " read POLL OPTS="" POLL="$POLL$NL" echo "# Enter poll options, 1 per line, end with blank line, ^D, or EOF:" for X in $LETTERS; do echo -n "$X > " read LINE [ "$LINE" ] || break OPTS="$OPTS $X" EMOJI=$(echo -e "\xf0\x9f\x87\x$X") POLL="$POLL$NL$EMOJI $LINE" done echo "$POLL$NL$NL""Please add your vote here:" | ./discord.sh --send for X in $OPTS; do sleep 0.2 ./discord.sh --react "%f0%9f%87%$X" done