Bump to v1.5

This commit is contained in:
Dr.Caduceus
2023-11-13 11:53:26 +05:30
committed by GitHub
parent c83a540e11
commit 649d733ba4

View File

@@ -1,21 +1,22 @@
from pyrogram.types import Message
from telethon.events import NewMessage
from telethon.tl.custom import Message
from bot import TelegramBot
from bot.modules.decorators import verify_user
from bot.modules.telegram import get_message, send_message
from bot.modules.static import *
from bot.modules.telegram import get_message
async def deeplinks(msg: Message, payload: str):
if payload.startswith('file_'):
sp = payload.split('_')
@TelegramBot.on(NewMessage(incoming=True, pattern=r'^/start file_'))
@verify_user(private=True)
async def send_file(event: NewMessage.Event | Message):
payload = event.raw_text.split()[-1].split('_')
if len(sp) != 3:
return await msg.reply(InvalidPayloadText, quote=True)
message = await get_message(int(sp[1]))
if len(payload) != 3:
return await event.reply(InvalidPayloadText)
message = await get_message(int(payload[1]))
if not message:
return await msg.reply(MessageNotExist)
if sp[2] != message.caption:
return await msg.reply(InvalidPayloadText, quote=True)
await message.copy(chat_id=msg.from_user.id, caption="")
else:
await msg.reply(InvalidPayloadText, quote=True)
if not message:
return await event.reply(MessageNotExist)
message.raw_text = ''
await send_message(message, send_to=event.chat_id)