Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions old_version/batbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ VERSION="1.4.3"
# or run BaTbot with option: -t <token>
TELEGRAMTOKEN="<your telegram token>";

#chat id added for security reasons
OWNERCHATID="<your telegram owner chat id>";

# how many seconds between check for new messages
# or run Batbot with option: -c <seconds>
CHECKNEWMSG=5;
Expand Down Expand Up @@ -149,8 +152,12 @@ while true; do
CMDORIG=${CMDORIG//@R2/${BASH_REMATCH[2]}};
CMDORIG=${CMDORIG//@R3/${BASH_REMATCH[3]}};

echo "Command ${s} received, running cmd: ${CMDORIG}"
CMDOUTPUT=`$CMDORIG`;
if [ $CHATID -eq $OWNERCHATID ]; then
echo "Command ${s} received, running cmd: ${CMDORIG}"
CMDOUTPUT=`$CMDORIG`;
else
CMDOUTPUT="Access denied";
fi

if [ $FIRSTTIME -eq 1 ]; then
echo "old message, i will not send any answer to user.";
Expand Down