Sing will now accept tracks with a :, bot config file is now bot.cfg.

This commit is contained in:
Storm Dragon 2016-09-06 12:08:29 -04:00
parent ee4ea5e271
commit 8e733593f0
3 changed files with 4 additions and 5 deletions

7
bot.sh
View File

@ -1,12 +1,12 @@
#!/bin/bash
[ -f functions.sh ] && source functions.sh
[ -f bot.properties ] && source bot.properties
[ -f bot.cfg ] && source bot.cfg
input=".botinput"
close_bot()
{
echo -en "QUIT :$quitMessage\r\n" >> "$input"
echo -en ":QUIT :$quitMessage\r\n" >> "$input"
rm "$input"
exit 0
}
@ -76,7 +76,6 @@ do
will="${com#* }"
com="${com%% *}"
if [ -z "$(ls modules/ | grep -i -- "$com")" ] || [ -z "$com" ]; then
./modules/help/help.sh "$who" "$from"
continue
fi
./modules/${com% *}/${com% *}.sh "$who" "$from" "$will"
@ -92,7 +91,7 @@ do
will=$(echo "$will" | perl -pe "s/^ +//")
com=$(echo "$will" | cut -d " " -f1)
if [ -z "$(ls modules/ | grep -i -- "$com")" ] || [ -z "$com" ]; then
./modules/help/help.sh $who $from
./modules/help/help.sh "$who" "$from"
continue
fi
./modules/$com/$com.sh $who $from $(echo "$will" | cut -d " " -f2-99)

View File

@ -5,7 +5,7 @@ shift
chan="$1"
shift
#get the lyric text into a variable
trackName="$@"
trackName="${@//:/ - }"
curl="$(command -v curl)"
trackName="$(echo "$trackName" | sed -e "s/ /_/g" -e 's/([[:print:]]*)//g' -e "s/['\/\.]//g" -e 's/&/and/g' -e 's/ö/o/g')"
artist="$(echo "${trackName,,}" | cut -d "-" -f 1 | sed -e 's/_$//' -e 's/^the_\(.*\)/\1_the/')"