From 28fc35959324b2e428c2c0ae9a26b06255f5cfdf Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Fri, 17 Feb 2023 16:46:13 +0100 Subject: [PATCH] WIP: export and import --- locale/en.json | 2 ++ locale/uk.json | 2 ++ plugins/commands/photos.py | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 plugins/commands/photos.py diff --git a/locale/en.json b/locale/en.json index 8d0ba88..4ca5c1b 100644 --- a/locale/en.json +++ b/locale/en.json @@ -5,6 +5,8 @@ }, "commands_admin": { "forwards": "Check post forwards", + "import": "Submit .zip archive with photos", + "export": "Get .zip archive with all photos", "reboot": "Restart the bot" }, "message": { diff --git a/locale/uk.json b/locale/uk.json index 0ffab70..e5305c9 100644 --- a/locale/uk.json +++ b/locale/uk.json @@ -5,6 +5,8 @@ }, "commands_admin": { "forwards": "Переглянути репости", + "import": "Надати боту .zip архів з фотографіями", + "export": "Отримати .zip архів з усіма фотографіями", "reboot": "Перезапустити бота" }, "message": { diff --git a/plugins/commands/photos.py b/plugins/commands/photos.py new file mode 100644 index 0000000..72a157e --- /dev/null +++ b/plugins/commands/photos.py @@ -0,0 +1,23 @@ +from os import getpid + +from pyrogram import filters +from classes.poster_client import PosterClient +from pyrogram.types import Message + +from modules.app import app +from modules.logger import logWrite +from modules.utils import configGet, killProc, locale + + +@app.on_message(~ filters.scheduled & filters.command(["import"], prefixes=["", "/"])) +async def cmd_import(app: PosterClient, msg: Message): + + if msg.from_user.id == configGet("admin"): + pass + + +@app.on_message(~ filters.scheduled & filters.command(["export"], prefixes=["", "/"])) +async def cmd_export(app: PosterClient, msg: Message): + + if msg.from_user.id == configGet("admin"): + pass \ No newline at end of file