Answer the question
In order to leave comments, you need to log in
Script problems. Where is the mistake?
Good evening!
I'm trying to run a script for a telegram bot on a free hosting. Tell me what's wrong?
What to write in line number 6? how to correctly specify the path to the file.list
link to your site and the site where the files are located are different, what to indicate?
!/usr/bin/env bash
https://имя.000webhostapp.com/
https://t.me/имя
chmod +x /имя.sh
botToken="токенбота";
channelId="-айдиканала";
channelName="@имяканала";
postImage=sort --random-sort /tpm/ИмяОткудаБрать.list | head -n 1
wget -q -O /dev/null "https://api.telegram.org/bot$botToken/sendPhoto?chat_id=$channelId&photo=$postImage&caption=$channelName&disable_notification=1"
removeImage=echo $postImage | cut -d "/" -f 6;
sed -i "/$removeImage/d" /tpm/ИмяОткудаБрать.list;
exit 0;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question