From 97b3aa1505e4471f9dd2d686e68785d9a0c8f840 Mon Sep 17 00:00:00 2001 From: profitroll Date: Wed, 28 Jun 2023 08:22:18 +0200 Subject: [PATCH] Starting scripts and README were updated --- README.md | 14 +++++++------- loop.bat | 2 +- loop.sh | 2 +- start.bat | 2 +- start.sh | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2a4b80d..4a0058f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/loop.bat b/loop.bat index 20b4b75..260cdf5 100644 --- a/loop.bat +++ b/loop.bat @@ -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 diff --git a/loop.sh b/loop.sh index 8ec2365..44a2f41 100644 --- a/loop.sh +++ b/loop.sh @@ -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 diff --git a/start.bat b/start.bat index 00f036e..e9a42b4 100644 --- a/start.bat +++ b/start.bat @@ -3,4 +3,4 @@ REM You can cd to your directory here, if you want REM cd C:\Users\user\TelegramPoster -python poster.py \ No newline at end of file +python main.py \ No newline at end of file diff --git a/start.sh b/start.sh index b5f9ff9..a3494da 100644 --- a/start.sh +++ b/start.sh @@ -3,4 +3,4 @@ # You can cd to your directory here, if you want # cd /home/user/TelegramPoster -python poster.py \ No newline at end of file +python main.py \ No newline at end of file