Starting scripts and README were updated

This commit is contained in:
Profitroll 2023-06-28 08:22:18 +02:00
parent 5adb004a2a
commit 97b3aa1505
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
5 changed files with 11 additions and 11 deletions

View File

@ -11,7 +11,7 @@ This bot is used for one and only task - post pictures from my personal archive.
## Dependencies
* [Python 3.7+](https://www.python.org) (3.9+ recommended)
* [Python 3.8+](https://www.python.org) (3.9+ recommended)
* [MongoDB](https://www.mongodb.com)
* [PhotosAPI](https://git.end-play.xyz/profitroll/PhotosAPI)
@ -54,7 +54,7 @@ To make this bot run at first you need to have a Python interpreter, Photos API,
1. Copy file `config_example.json` to `config.json`
2. Open `config.json` using your favorite text editor. For example `nano config.json`, but you can edit with vim, nano, on Windows it's Notepad or Notepad++. Whatever
3. Change `"owner"`, `"bot.api_id"`, `"bot.api_hash"` and `"bot.bot_token"` keys' values.
3. Change `"bot.owner"`, `"reports.chat_id"`, `"bot.api_id"`, `"bot.api_hash"` and `"bot.bot_token"` keys' values.
If you don't know where to find bot_token and your id - here you can find some hints: [get bot token](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token), [get your id](https://www.alphr.com/telegram-find-user-id), [get api_hash and api_id](https://core.telegram.org/api/obtaining_api_id).
@ -67,11 +67,11 @@ To make this bot run at first you need to have a Python interpreter, Photos API,
2. Configure Photos API:
1. Change `"posting.api.address"` to the one your API servers uses
2. Run your bot using `python poster.py --create-user --create-album` to configure its new user and album. You can also use manual user and album creation described [in the wiki](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Configuring-API). You can also change username, password and album in`"posting.api"` to the user and album you have if you already have Photos API album and user set up. In that case you don't need to create a new one.
2. Run your bot using `python main.py --create-user --create-album` to configure its new user and album. You can also use manual user and album creation described [in the wiki](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Configuring-API). You can also change username, password and album in`"posting.api"` to the user and album you have if you already have Photos API album and user set up. In that case you don't need to create a new one.
7. Add bot to the channel:
To use your bot of course you need to have a channel or group otherwise makes no sense to have such a bot. [Here](https://stackoverflow.com/a/33497769) you can find a quick guide how to add your bot to a channel. After that simply set `"posting.channel"` to your channel's ID.
To use your bot of course you need to have a channel or group otherwise makes no sense to have such a bot. [Here](https://stackoverflow.com/a/33497769) you can find a quick guide how to add your bot to a channel. After that simply set `"posting.channel"` to your channel's ID and `"posting.comments"` to comments group's ID.
8. Configure posting time:
@ -79,7 +79,7 @@ To make this bot run at first you need to have a Python interpreter, Photos API,
9. Good to go, run it!
Make sure MongoDB and Photos API are running and use `python poster.py` to start it.
Make sure MongoDB and Photos API are running and use `python main.py` to start it.
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 `/shutdown` command.
@ -94,8 +94,8 @@ Of course bot also has them. You can perform some actions with them.
Examples:
* `python poster.py --create-user`
* `python poster.py --create-user --create-album`
* `python main.py --create-user`
* `python main.py --create-user --create-album`
## Tips and improvements

View File

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

View File

@ -5,7 +5,7 @@
while true
do
python poster.py
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

View File

@ -3,4 +3,4 @@
REM You can cd to your directory here, if you want
REM cd C:\Users\user\TelegramPoster
python poster.py
python main.py

View File

@ -3,4 +3,4 @@
# You can cd to your directory here, if you want
# cd /home/user/TelegramPoster
python poster.py
python main.py