Add files via upload

dev
Ruslan-Isaev 2025-02-05 03:46:23 +03:00 committed by GitHub
parent a189089d47
commit 30eb22f5be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 38 additions and 0 deletions

38
Quotly.py 100644
View File

@ -0,0 +1,38 @@
version = (1, 0, 0)
# meta developer: @RUIS_VlP
import telethon
from .. import loader, utils
@loader.tds
class QuotlyMod(loader.Module):
"""Модуль для создания стикеров по сообщению через @QuotLyBot"""
strings = {
"name": "Quotly",
}
async def on_dlmod(self):
await self.client.send_message("@QuotLyBot", "/start")
bot = ["@QuotLyBot", 1031952739]
@loader.command()
async def quotly(self, message):
"""<reply> - создать стикер по сообщению"""
reply = await message.get_reply_message()
try: chat_id = message.chat_id
except: chat_id = (await utils.get_user(message)).id
if not reply:
await utils.answer(message, "❌ <b>Команда должна быть ответом на сообщение!</b>")
return
try:
async with message.client.conversation(self.bot[0]) as conv:
forward = await reply.forward_to(self.bot[0])
answer = await conv.wait_event(telethon.events.NewMessage(incoming=True, from_users=self.bot[1]))
await utils.answer_file(message, answer.message)
await forward.delete()
await answer.delete()
except Exception as e:
await utils.answer(message, f"❌ <b>Ошибка!</b>\n\n<code>{e}</code>")