Added start scripts

This commit is contained in:
Profitroll 2022-08-09 12:30:36 +02:00
parent 71d1efa82b
commit a29fd26046
5 changed files with 50 additions and 1 deletions

View File

@ -4,6 +4,12 @@ This bot is used for one and only task - post pictures from my personal archive.
## Installation ## Installation
To make this bot run at first you need to have a Python interpreter and git. Google is your friend finding it. You can also ignore git and simply download source code, should also work fine. After that you're ready to go. To make this bot run at first you need to have a Python interpreter and git. Google is your friend finding it. You can also ignore git and simply download source code, should also work fine. After that you're ready to go.
> In this README I assume that you're using default python in your
> system and your system's PATH contains it. If your default python
> is `python3` or for example `/home/user/.local/bin/python3.9` - use it instead.
> If it's non-standart executable path - you should also change
> it in scripts you will use (`loop.sh`, `loop.bat`, `start.sh` and `start.bat`).
1. Download the bot. 1. Download the bot.
1. `git clone https://git.end-play.xyz/profitroll/TelegramSender.git` (if you want to use git) 1. `git clone https://git.end-play.xyz/profitroll/TelegramSender.git` (if you want to use git)
2. `cd ./TelegramSender` 2. `cd ./TelegramSender`
@ -28,7 +34,9 @@ To make this bot run at first you need to have a Python interpreter and git. Goo
Of course bot cannot post something from nothing. Configure your `config.json` what media types bot should post (`"posting", "extensions"`), when to post them (`"posting", "time"`) and also where to find them (`"locations"`). You can also move them when sent by setting `"posting", "move_sent"` to `true`. Of course bot cannot post something from nothing. Configure your `config.json` what media types bot should post (`"posting", "extensions"`), when to post them (`"posting", "time"`) and also where to find them (`"locations"`). You can also move them when sent by setting `"posting", "move_sent"` to `true`.
6. Good to go, run it! 6. Good to go, run it!
`python ./main.py` `python ./main.py`
Or you can also use `.\start.bat` on Windows and `bash ./start.sh` on Linux.
Additionally there are `loop.sh` and `loop.bat` available if you want your bot to start again after being stopped or after using `/reboot` command.
## Command line arguments ## Command line arguments
Of course bot also has them. You can perform some actions with them. Of course bot also has them. You can perform some actions with them.

12
loop.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
REM You can cd to your directory here, if you want
REM cd C:\Users\user\TelegramPoster
:start
python main.py
echo To completely stop TelegramPoster now, please press Ctrl+C during the countdown!
echo Restarting in 5 seconds...
Timeout /t 5
echo TelegramPoster has started!
goto start

17
loop.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# You can cd to your directory here, if you want
# cd /home/user/TelegramPoster
while true
do
python main.py
echo "To completely stop TelegramPoster now, please press Ctrl+C during the countdown!"
echo "Restarting in:"
for i in 5 4 3 2 1
do
echo "$i..."
sleep 1
done
echo "TelegramPoster has started!"
done

6
start.bat Normal file
View File

@ -0,0 +1,6 @@
@echo off
REM You can cd to your directory here, if you want
REM cd C:\Users\user\TelegramPoster
python main.py

6
start.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# You can cd to your directory here, if you want
# cd /home/user/TelegramPoster
python main.py