Add modules' creators propriety gesture to HikkaDL (Automatic reaction when downloading via button)

pull/1/head
hikari.ftg 2022-04-07 11:17:10 +00:00
parent bd6f35878d
commit 737dfd8343
1 changed files with 12 additions and 0 deletions

View File

@ -18,6 +18,7 @@ from .._types import LoadError
import json
import re
import websockets
from telethon.tl.functions.messages import SendReactionRequest
logger = logging.getLogger(__name__)
@ -72,6 +73,17 @@ class HikkaDLMod(loader.Module):
await wss.send("🚫 Origin is not allowed")
continue
try:
await self._client(
SendReactionRequest(
peer=ans["channel"],
msg_id=ans["message_id"],
reaction="❤️",
)
)
except Exception:
pass
m = await self._client.send_message("me", f".dlmod {link}")
await self.allmodules.commands["dlmod"](m)
load = (await self._client.get_messages(m.peer_id, ids=[m.id]))[0]