azils3/bash
0
1# Ultroid - UserBot2# Copyright (C) 2021-2025 TeamUltroid3#4# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >5# PLease read the GNU Affero General Public License in6# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.7"""8✘ Commands Available -9 10•`{i}glitch <reply to media>`11 gives a glitchy gif.12"""13import os14 15from . import bash, get_string, mediainfo, ultroid_cmd16 17 18@ultroid_cmd(pattern="glitch$")19async def _(e):20 try:21 import glitch_me # ignore :pylint22 except ModuleNotFoundError:23 await bash(24 "pip install -e git+https://github.com/1Danish-00/glitch_me.git#egg=glitch_me"25 )26 reply = await e.get_reply_message()27 if not reply or not reply.media:28 return await e.eor(get_string("cvt_3"))29 xx = await e.eor(get_string("glitch_1"))30 wut = mediainfo(reply.media)31 if wut.startswith(("pic", "sticker")):32 ok = await reply.download_media()33 elif reply.document and reply.document.thumbs:34 ok = await reply.download_media(thumb=-1)35 else:36 return await xx.eor(get_string("com_4"))37 cmd = f"glitch_me gif --line_count 200 -f 10 -d 50 '{ok}' ult.gif"38 await bash(cmd)39 await e.reply(file="ult.gif", force_document=False)40 await xx.delete()41 os.remove(ok)42 os.remove("ult.gif")43 