WIP: Media import/export
This commit is contained in:
parent
06b6b49f43
commit
a4323981fb
@ -1,5 +1,6 @@
|
||||
from modules.utils import configGet
|
||||
from classes.poster_client import PosterClient
|
||||
from convopyro import Conversation
|
||||
|
||||
app = PosterClient(
|
||||
"duptsiaposter",
|
||||
@ -7,3 +8,5 @@ app = PosterClient(
|
||||
api_id=configGet("api_id", "bot"),
|
||||
api_hash=configGet("api_hash", "bot"),
|
||||
)
|
||||
|
||||
Conversation(app)
|
||||
|
@ -1,5 +1,6 @@
|
||||
from pyrogram import filters
|
||||
from pyrogram.types import Message
|
||||
from convopyro import listen_message
|
||||
|
||||
from classes.poster_client import PosterClient
|
||||
from modules.app import app
|
||||
@ -8,7 +9,15 @@ from modules.app import app
|
||||
@app.on_message(~filters.scheduled & filters.command(["import"], prefixes=["", "/"]))
|
||||
async def cmd_import(app: PosterClient, msg: Message):
|
||||
if msg.from_user.id in app.admins:
|
||||
pass
|
||||
print("Listening to file...", flush=True)
|
||||
answer = await app.listen.Message(
|
||||
filters.document, id=filters.user(msg.from_user.id), timeout=None
|
||||
)
|
||||
if answer is None:
|
||||
return
|
||||
print("Gotcha", flush=True)
|
||||
await answer.reply_text("Gotcha")
|
||||
return
|
||||
|
||||
|
||||
@app.on_message(~filters.scheduled & filters.command(["export"], prefixes=["", "/"]))
|
||||
|
@ -49,7 +49,9 @@ async def get_submission(app: PosterClient, msg: Message):
|
||||
)
|
||||
if msg.document.mime_type not in configGet("mime_types", "submission"):
|
||||
await msg.reply_text(
|
||||
locale("mime_not_allowed", "message", locale=user_locale),
|
||||
locale("mime_not_allowed", "message", locale=user_locale).format(
|
||||
", ".join(configGet("mime_types", "submission"))
|
||||
),
|
||||
quote=True,
|
||||
)
|
||||
return
|
||||
|
@ -64,6 +64,9 @@ if configGet("submit", "mode"):
|
||||
from plugins.commands.mode_submit import *
|
||||
from plugins.handlers.submission import *
|
||||
|
||||
if configGet("post", "mode"):
|
||||
from plugins.commands.photos import *
|
||||
|
||||
# if configGet("api_based", "mode"):
|
||||
# from modules.api_client import authorize
|
||||
# ===========================================================================================================================================
|
||||
|
@ -1 +1 @@
|
||||
tgcrypto~=1.2.5
|
||||
tgcrypto==1.2.5
|
@ -1,6 +1,7 @@
|
||||
apscheduler~=3.10.1
|
||||
pyrogram~=2.0.102
|
||||
pytimeparse~=1.1.8
|
||||
convopyro==0.5
|
||||
pyrogram~=2.0.102
|
||||
aiofiles~=23.1.0
|
||||
aiohttp~=3.8.4
|
||||
psutil~=5.9.4
|
||||
|
Reference in New Issue
Block a user