This bot is used for one and only task - post pictures from my personal archive.
This repository has been archived on 2024-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Renovate 6f03d5c18f Configure Renovate (#14)
Welcome to [Renovate](https://github.com/renovatebot/renovate)! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.

---
### Detected Package Files

 * `requirements.txt` (pip_requirements)

### Configuration Summary

Based on the default config's presets, Renovate will:

  - Start dependency updates only once this onboarding PR is merged
  - Enable Renovate Dependency Dashboard creation.
  - Use semantic commit type `fix` for dependencies and `chore` for all others if semantic commits are in use.
  - Ignore `node_modules`, `bower_components`, `vendor` and various test/tests directories.
  - Group known monorepo packages together.
  - Use curated list of recommended non-monorepo package groupings.
  - Apply crowd-sourced package replacement rules.
  - Apply crowd-sourced workarounds for known problems with packages.

🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the `.renovaterc` in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.

---

### What to Expect

It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.

---

 Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section.
If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions).

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Reviewed-on: #14
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2023-04-20 14:40:36 +03:00
classes/enums WIP: API usage as main 2023-02-15 14:06:06 +01:00
locale WIP: API usage as main 2023-02-15 14:06:06 +01:00
modules WIP: API usage as main 2023-02-15 14:06:06 +01:00
plugins WIP: API usage as main 2023-02-15 14:06:06 +01:00
.gitignore Updated ignore 2023-02-15 11:56:05 +01:00
.renovaterc Configure Renovate (#14) 2023-04-20 14:40:36 +03:00
config.json WIP: API usage as main 2023-02-15 14:06:06 +01:00
LICENSE Initial commit 2022-08-08 14:53:26 +02:00
loop.bat Main executable name changed 2022-08-30 13:51:24 +02:00
loop.sh Main executable name changed 2022-08-30 13:51:24 +02:00
poster.py WIP: API usage as main 2023-02-14 16:25:56 +01:00
README_uk.md "locale_log" explanation added 2022-09-18 18:13:40 +02:00
README.md "locale_log" explanation added 2022-09-18 18:13:40 +02:00
requirements-optional.txt Moved to apscheduler 2023-01-09 15:36:56 +01:00
requirements.txt Added database support 2023-02-14 14:45:52 +01:00
start.bat Main executable name changed 2022-08-30 13:51:24 +02:00
start.sh Main executable name changed 2022-08-30 13:51:24 +02:00

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 ;)

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.

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. git clone https://git.end-play.xyz/profitroll/TelegramSender.git (if you want to use git)
    2. cd ./TelegramSender
  2. Install dependencies:
    python -m pip install -r requirements.txt
    Without installing those - bot cannot work at all

  3. Install optional dependencies [Not required]:
    python -m pip install -r requirements-optional.txt
    These are not required but can make the bot run a bit faster

  4. Configure your bot with a favorite text editor:
    nano config.json
    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, get your id, get api_hash and api_id.
    Also don't forget to change bot's working mode. Dict key "mode" contains keys "post" and "submit", each of those can be either true or false.

  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 you can find a quick guide how to add your bot to a channel.

  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.

  7. Good to go, run it!
    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

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 triggering the bot start itself

Examples:

  • python3 ./main.py --move-sent --norun
  • python3 ./main.py --cleanup --confirm

Localization

Bot is capable of using custom locales. There are some that are pre-installed (English and Ukrainian), however you can add your own locales too.

All localization files are located in the locale folder, otherwise in folder specified in config file. Just copy locale file of your choice, name it in accordance to IETF language tags (if you want your locale to be compatible with Telegram's locales) or define your own name. Save it as json and you're good to go. If you want to change default locale for messages, that cannot determine admin's locale - edit "locale" parameter in the config.json. If this locale is not available - "locale_fallback" will be used instead. If both are not available - error will be shown. For console output and logging locale you should edit "locale_log".

We recommend to only make changes to your custom locale. Or at least always have your backup of for example en.json as your fallback.