Files
Ultroid-fork/plugins/glitch.py
Danish bef7479be0 Bug fixes V0.0.5
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: Danish <danish@ultroid.tech>
Co-authored-by: buddhhu <buddhuu@users.noreply.github.com>
Co-authored-by: sppidy <sppidy@users.noreply.github.com>
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: divkix <divkix@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
Co-authored-by: Programming Error <error@notavailable.live>
Co-authored-by: New-dev0 <New-dev0@notavailable.live>
2021-04-15 18:37:02 +05:30

43 lines
1.1 KiB
Python

# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
•`{i}glitch <replt to media>`
gives a glitchy gif.
"""
import os
from . import *
@ultroid_cmd(pattern="glitch$")
async def _(e):
reply = await e.get_reply_message()
if not (reply and reply.media):
return await eor(e, "Reply to any media")
wut = mediainfo(reply.media)
if not wut.startswith(("pic", "sticker")):
return await eor(e, "`Unsupported Media`")
xx = await eor(e, "`Gliching...`")
ok = await bot.download_media(reply.media)
cmd = f"glitch_me gif --line_count 200 -f 10 -d 50 '{ok}' ult.gif"
stdout, stderr = await bash(cmd)
await ultroid_bot.send_file(
e.chat_id, "ult.gif", force_document=False, reply_to=reply
)
await xx.delete()
os.remove(ok)
os.remove("ult.gif")
HELP.update({f"{__name__.split('.')[1]}": f"{__doc__.format(i=HNDLR)}"})