mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-18 15:14:18 +02:00
Commited backup
This commit is contained in:
23
Fl1yd/FTG-Modules/reverse.py
Normal file
23
Fl1yd/FTG-Modules/reverse.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from .. import loader, utils
|
||||
from telethon.errors import MessageEmptyError
|
||||
|
||||
def register(cb):
|
||||
cb(ReverseMod())
|
||||
|
||||
class ReverseMod(loader.Module):
|
||||
"""Реверс текста."""
|
||||
strings = {'name': 'Reverse'}
|
||||
|
||||
async def revcmd(self, message):
|
||||
"""Используй .rev <текст или реплай>."""
|
||||
try:
|
||||
text = utils.get_args_raw(message)
|
||||
reply = await message.get_reply_message()
|
||||
if not text and not reply:
|
||||
return await message.edit("Нет текста или реплая.")
|
||||
if reply:
|
||||
return await message.edit(f"{reply.raw_text}"[::-1])
|
||||
if text:
|
||||
return await message.edit(f"{text}"[::-1])
|
||||
except MessageEmptyError:
|
||||
return await message.edit("Это не текст.")
|
||||
Reference in New Issue
Block a user