This commit is contained in:
2022-08-10 13:08:15 +02:00
parent ac509194da
commit e03c862a35
8 changed files with 294 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
# TelegramPoster
This bot is used for one and only task - post pictures from my personal archive. Here's its source code so you can also host a bot and have fun with it. Just don't exepect it to be brilliant. It is not. But hey, you can always fork it ;)
This bot is used for one and only task - post pictures from my personal archive. Here's its source code so you can also host a bot and have fun with it. Just don't exepect it to be brilliant. It is not. But hey, you can always fork it ;)
Шукаєш інструкцію українською? А вона [ось тут](https://git.profitroll.eu/profitroll/TelegramPoster/src/branch/master/README_uk.md) знаходиться)
## 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.
@@ -10,7 +11,7 @@ To make this bot run at first you need to have a Python interpreter and git. Goo
> 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)
2. `cd ./TelegramSender`
@@ -27,10 +28,10 @@ To make this bot run at first you need to have a Python interpreter and git. Goo
You can edit with vim, nano, on Windows it's Notepad or Notepad++. Whatever.
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).
5. Add bot to the channel
5. 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.
6. Fill your contents folder
6. Fill your contents folder:
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!
@@ -43,7 +44,7 @@ Of course bot also has them. You can perform some actions with them.
* `--move-sent` - allows you to move all sent files from queue to sent directories
* `--cleanup` - purge files in both `queue` and `sent` folders if they're sent. Requires `--confirm` argument
* `--cleanup-index` - purge all sent entries from index. Requires `--confirm` argument
* `--norun` - allows you to execute above arguments without tiggering the bot start itself
* `--norun` - allows you to execute above arguments without triggering the bot start itself
Examples:
* `python3 ./main.py --move-sent --norun`