Files
limoka/trololo65/Modules/LsSend.py
2025-07-11 08:27:20 +00:00

33 lines
1.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# meta developer: @trololo_1
from .. import loader, utils
@loader.tds
class LsSendMod(loader.Module):
"""Отправка смс в лс по юзеру пользователя."""
strings = {'name':'LsSend'}
async def sendcmd(self, message):
""" .send {юзер} {текст или реплай}"""
try:
reply = await message.get_reply_message()
text = utils.get_args_raw(message)
id = str(text.split(' ')[0])
check = []
for i in text.split(' '):
check.append(i)
if len(check) <= 1:
send = reply
else:
send = str(text.split(' ', maxsplit=1)[1])
if send:
await message.client.send_message(id, send)
await message.edit('<b>Сообщение успешно отправлено!</b>')
else:
await message.edit('<b>Не было сделано реплая или нет текста.</b>')
except:
await message.edit('<b>Неверный юзер, юзера нет вообще, либо ещё какая то ошибка.</b>')