Files
limoka/Fl1yd/FTG-Modules/urlshortener.py
2025-07-10 21:02:34 +03:00

17 lines
561 B
Python
Raw 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.

import os
from .. import loader, utils
def register(cb):
cb(URLShortenerMod())
class URLShortenerMod(loader.Module):
"""Сократитель ссылок"""
strings = {'name': 'URLShortener'}
async def lgtcmd(self, message):
"""Сократить ссылку с помощью сервиса verylegit.link"""
args = utils.get_args_raw(message)
if not args: return await message.edit("Нет аргументов.")
link = os.popen(f"curl verylegit.link/sketchify -d long_url={args}").read()
await message.edit(f"Ссылка:\n> {link}")