mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-23 07:52:00 +00:00
use while loop for broadcast
This commit is contained in:
parent
863f09a52b
commit
f55571306a
@ -538,13 +538,14 @@ case "$1" in
|
|||||||
rm -f -r "${TMPDIR:-.}/$3"
|
rm -f -r "${TMPDIR:-.}/$3"
|
||||||
;;
|
;;
|
||||||
"count")
|
"count")
|
||||||
echo "A total of $(wc -l "${COUNT}" | sed 's/count//g')users used me."
|
echo "A total of $(wc -l <"${COUNT}") users used me."
|
||||||
;;
|
;;
|
||||||
"broadcast")
|
"broadcast")
|
||||||
echo "Sending the broadcast $* to $(wc -l "${COUNT}" | sed 's/count//g')users."
|
NUMCOUNT="$(wc -l <"${COUNT}")"
|
||||||
[ "$(wc -l "${COUNT}" | sed 's/ count//g')" -gt "300" ] && sleep="sleep 0.5"
|
echo "Sending the broadcast $* to $NUMCOUNT users."
|
||||||
|
[ "$NUMCOUNT" -gt "300" ] && sleep="sleep 0.5"
|
||||||
shift
|
shift
|
||||||
for f in $(cat "${COUNT}"); do send_message "${f//COUNT}" "$*"; $sleep;done
|
while read -r f; do send_message "${f//COUNT}" "$*"; $sleep; done <"${COUNT}"
|
||||||
;;
|
;;
|
||||||
"start")
|
"start")
|
||||||
$CLEAR
|
$CLEAR
|
||||||
|
Loading…
Reference in New Issue
Block a user