mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-30 02:53:52 +00:00
Fixed bug when script prints content right before exiting
This commit is contained in:
parent
decd11ee0a
commit
495c23def4
12
bashbot.sh
12
bashbot.sh
@ -148,16 +148,16 @@ forward() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startproc() {
|
startproc() {
|
||||||
rm -r $copname
|
(rm -r $copname
|
||||||
|
tmux kill-session -t $copname)2>/dev/null
|
||||||
|
|
||||||
mkfifo $copname
|
mkfifo $copname
|
||||||
tmux kill-session -t $copname
|
TMUX= tmux new-session -d -s $copname "./question &>$copname; sleep 10; rm -r $copname"
|
||||||
TMUX= tmux new-session -d -s $copname "./question &>$copname"
|
while [ -p "$copname" ];do
|
||||||
while tmux ls | grep -q $copname;do
|
|
||||||
read -t 10 line
|
read -t 10 line
|
||||||
[ "$line" != "" ] && send_message "${USER[ID]}" "$line"
|
[ "$line" != "" ] && send_message "${USER[ID]}" "$line"
|
||||||
line=
|
line=
|
||||||
done <$copname
|
done <$copname
|
||||||
rm -r $copname
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inproc() {
|
inproc() {
|
||||||
@ -225,7 +225,7 @@ Available commands:
|
|||||||
/info: Get shorter info message about this bot.
|
/info: Get shorter info message about this bot.
|
||||||
/question: Start interactive chat.
|
/question: Start interactive chat.
|
||||||
/cancel: Cancel any currently running interactive chats.
|
/cancel: Cancel any currently running interactive chats.
|
||||||
Written by @topkecleon, Juan Potato (@awkward_potato), Lorenzo Santina (BigNerd95) and Daniil Gentili (danog)
|
Written by @topkecleon, Juan Potato (@awkward_potato), Lorenzo Santina (BigNerd95) and Daniil Gentili (@danogentili)
|
||||||
Contribute to the project: https://github.com/topkecleon/telegram-bot-bash
|
Contribute to the project: https://github.com/topkecleon/telegram-bot-bash
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user