Exemplo n.º 1
0
import os, shutil, sys ,cv2, asyncio, scipy, random
from telegraph import upload_file
from telethon.tl.types import MessageMediaPhoto
from ub.utils import admin_cmd
from ub import bot , CMD_HELP
from ub import bot as borg
path = "./dcobra/"
if not os.path.isdir(path):
    os.makedirs(path)


# Originally Created by @danish_00 
# All Basics opencv just , the .rtoon was little challenging


@bot.on(admin_cmd("rtoon"))
async def hehe(event):
    if not event.reply_to_msg_id:
        await event.reply("Reply to any Image.")
        return
    reply = await event.get_reply_message()
    image = await bot.download_media(reply.media, path)
    await event.edit("`Processing... takes time`")
    img = cv2.VideoCapture(image) 
    ret, frame = img.read() 
    height, width, channels = frame.shape
    samples = np.zeros([height*width, 3], dtype = np.float32)
    count = 0
    for x in range(height):
        for y in range(width):
           samples[count] = frame[x][y] 
Exemplo n.º 2
0
from telethon import events
import subprocess, os, asyncio, PIL, cv2, shutil
from ub.utils import admin_cmd
from ub import bot
path = "./dcobra/"
if not os.path.isdir(path):
    os.makedirs(path)


@bot.on(admin_cmd(pattern="rgif"))
async def _(event):
    if event.fwd_from:
        return
    reply = await event.get_reply_message()
    download = await bot.download_media(reply.media, path)
    img = cv2.VideoCapture(download)
    ret, frame = img.read()
    cv2.imwrite("danish.png", frame)
    danish = PIL.Image.open("danish.png")
    dark, python = danish.size
    cobra = f"""ffmpeg -f lavfi -i color=c=00ff00:s={dark}x{python}:d=10 -loop 1 -i danish.png -filter_complex "[1]rotate=angle=PI*t:fillcolor=none:ow='hypot(iw,ih)':oh=ow[fg];[0][fg]overlay=x=(W-w)/2:y=(H-h)/2:shortest=1:format=auto,format=yuv420p" -movflags +faststart danish.mp4 -y"""
    await event.edit("```Processing ...```")
    if event.reply_to_msg_id:
        reply_to_id = event.reply_to_msg_id
    process = await asyncio.create_subprocess_shell(
        cobra, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
    stdout, stderr = await process.communicate()
    await event.edit("```Uploading...```")
    await event.client.send_file(event.chat_id,
                                 "danish.mp4",
                                 force_document=False,
Exemplo n.º 3
0
# All rights reserved.
#PORTED TO JAVES BY SH1VAM
import asyncio
import os
from re import match

import aiofiles
from selenium import webdriver
from ub import bot as javes
from ub.javes_main.heroku_var import Config
from ub.utils import admin_cmd
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager


@javes.on(admin_cmd("webss (.*)"))
async def webss(message):
    shiva = message.text
    shivam = shiva[7:]
    link_match = match(r"\bhttps?://.*\.\S+", shivam)
    if not link_match:
        await message.edit("`I need a valid link to take screenshots from.`")
        return
    link = link_match.group()
    await message.edit("`Processing ...`")
    chrome_options = webdriver.ChromeOptions()
    chrome_options.binary_location = Config.GOOGLE_CHROME_BIN
    chrome_options.add_argument("--ignore-certificate-errors")
    chrome_options.add_argument("--test-type")
    chrome_options.add_argument("--headless")
    chrome_options.add_argument("--no-sandbox")
Exemplo n.º 4
0
import datetime
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from ub.utils import admin_cmd
from ub import bot as javes


@javes.on(admin_cmd(pattern="translat ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    if not event.reply_to_msg_id:
        await event.edit("```Reply to any user message.```")
        return
    reply_message = await event.get_reply_message()
    if not reply_message.text:
        await event.edit("```Reply to text message```")
        return
    chat = "lang_translate_bot"
    sender = reply_message.sender
    await event.edit("```translating```")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=710326518))

            await event.client.forward_messages(chat, reply_message)
            response = await response

        except YouBlockedUserError:
Exemplo n.º 5
0
#MADE BY SHIVAM DONT KANG
import cv2
from ub import CMD_HELP
#MADE BY SHIVAM DONT KANG
#MADE BY SHIVAM DONT KANG
from telegraph import upload_file
from ub.utils import admin_cmd
from ub import bot
from ub import bot as borg
import os, shutil
op = "./png_to_ico/"
if not os.path.isdir(op):
    os.makedirs(op)


@borg.on(admin_cmd(pattern=r"pti"))
async def miraculous(event):

    await event.delete()
    ico = await event.get_reply_message()
    pti = await borg.download_media(ico.media, op)
    miraculous = cv2.VideoCapture(pti)
    ladybug, catnoar = miraculous.read()
    cv2.imwrite("shivamico.png", catnoar)
    try:
        imgae = Image.open("shivamico.png")
        imgae.save('shivamico.ico')
        await event.client.send_file(event.chat_id,
                                     "shivamico.ico",
                                     force_document=False,
                                     reply_to=event.reply_to_msg_id)
Exemplo n.º 6
0
#made by shivam patel
from telethon import events

import asyncio

from ub.utils import admin_cmd
from ub import bot as javes
from telethon import events

from ub import CMD_HELP


@javes.on(admin_cmd("newyear"))
async def _(event):
    if event.fwd_from:
        return
    animation_interval = 1
    animation_ttl = range(0, 80)
    await event.edit("😊 HAPPY NEW YEAR 😁")
    animation_chars = [
        "💖HAPPY NEW YEAR💖",
        "💙HAPPY NEW YEAR💙",
        "❤️HAPPY NEW YEAR❤️",
        "💚HAPPY NEW YEAR💚",
        "💜HAPPY NEW YEAR💜",
    ]

    for i in animation_ttl:

        await asyncio.sleep(animation_interval)
        await event.edit(animation_chars[i % 5])
Exemplo n.º 7
0
from PIL import Image
import sys
import os
from ub.utils import admin_cmd
from ub import bot
from ub import bot as borg
if not os.path.isdir("./rpic/"):
    os.makedirs("./rpic/")


@bot.on(admin_cmd(pattern=r"rpic"))
async def scan(event):
    path = "rpic"

    kk = await event.delete()

    reply = await event.get_reply_message()

    lol = await borg.download_media(reply.media, path)
    linc = event.text
    link = linc[6:]
    pic = linc[30:]
    import cv2
    img = cv2.VideoCapture(lol)
    tales, miraculous = img.read()

    os.system(f'wget {link}')

    imagePath = cv2.imwrite("shivam.jpg", miraculous)

    maskPath = f"{pic}"
Exemplo n.º 8
0
import os,shutil
from ub.utils import admin_cmd
from ub import bot 
from ub import bot as borg
spath="./shivamwriter/"
if not os.path.isdir(spath):
    os.makedirs(spath)
#made by shivam 
# donot kang

# Keep credits

@bot.on(admin_cmd(pattern=r"replace"))
async def replace(event):

    ss=event.text
    shivam=ss[9:]
    place,replace=shivam.split(",")
    kk = await event.delete()

    reply = await event.get_reply_message()
    
    lol = await borg.download_media(reply.media, spath)
    file = open(lol, "rt")
    data = file.read()
    data = data.replace(place,replace)
    file.close()
    file = open(lol, "wt")
    file.write(data)
    file.close()
    await bot.send_file(
Exemplo n.º 9
0
async def reply_id(event):
    reply_to_id = None
    if event.sender_id in Config.SUDO_USERS:
        reply_to_id = event.id
    if event.reply_to_msg_id:
        reply_to_id = event.reply_to_msg_id
    return reply_to_id
async def make_gif(event, reply, quality=None, fps=None):
    fps = fps or 1
    quality = quality or 256
    result_p = os.path.join("temp", "animation.gif")
    animation = lottie.parsers.tgs.parse_tgs(reply)
    with open(result_p, "wb") as result:
        await run_sync(lottie.exporters.gif.export_gif, animation, result, quality, fps)
    return result_p
@bot.on(admin_cmd(pattern="roundv ?(.*)", outgoing=True))

async def video_catfile(event):
    reply = await event.get_reply_message()
    input_str = "".join(event.text.split(maxsplit=1)[1:])
    if input_str:
        path = Path(input_str)
        if not os.path.exists(path):
            await event.edit(
                f"`there is no such directory/file with the name {path} to upload`",
            )
            return
        catevent = await event.edit( "`Converting to video note..........`")
        filename = os.path.basename(path)
        catfile = os.path.join("./temp", filename)
        copyfile(path, catfile)
Exemplo n.º 10
0
#modie fied and ported to javes 3.0 by Sh1vam
import io
from random import randint, uniform

from PIL import Image, ImageEnhance, ImageOps
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.types import DocumentAttributeFilename
from ub.utils import admin_cmd
from ub import bot,CMD_HELP

from ub import bot as borg



@bot.on(admin_cmd(pattern="deepfry(?: |$)(.*)", outgoing=True))
async def deepfryer(event):
    try:
        frycount = int(event.pattern_match.group(1))
        if frycount < 1:
            raise ValueError
    except ValueError:
        frycount = 1
    if event.is_reply:
        reply_message = await event.get_reply_message()
        data = await check_media(reply_message)
        if isinstance(data, bool):
            event = await event.edit( "`I can't deep fry that!`")
            return
    if not event.is_reply:
        event = await event.edit( "`Reply to an image or sticker to deep fry it!`"
Exemplo n.º 11
0
import os
#MADE BY SHIVAM DONT KANG
import cv2
from ub import CMD_HELP
#MADE BY SHIVAM DONT KANG
#MADE BY SHIVAM DONT KANG
from telegraph import upload_file
from telethon.tl.types import MessageMediaPhoto
from ub.utils import admin_cmd
from ub import bot 
from ub import bot as borg
import os , shutil
sedpath = "./s_h_i_v_a_m_Javes/"
if not os.path.isdir(sedpath):
    os.makedirs(sedpath)
@borg.on(admin_cmd(pattern=r"cblur"))
async def hom(event):
    if not event.reply_to_msg_id:
        await event.reply("Reply to any Image.")
        return
    await event.delete()
    sed = await event.get_reply_message()
    linc = event.text
    links=linc[7:]
    kaboom,kabum=links.split(",")

    if isinstance(sed.media, MessageMediaPhoto):
        img = await borg.download_media(sed.media, sedpath)
    elif "image" in sed.media.document.mime_type.split("/"):
        img = await borg.download_media(sed.media, sedpath)
    else:
Exemplo n.º 12
0
#plugin made by @helloji123bot
#keep credits if you are gonna kang it lol,you noob ,stupid,madafucking,avengers_leader,the copy paster
import asyncio
from ub.utils import admin_cmd
from ub import  bot as borg
@borg.on(admin_cmd(pattern="animate (.*)"))
async def _(event):
    name = event.pattern_match.group(1)
    if event.fwd_from:
        return
    animation_interval = 0.5
    animation_ttl = range(192)
    animation_chars = [
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
   f"⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️..**{name}**..⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n",
   f"⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️..**{name}**..⚪️⚫️⚪️\n⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️\n⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️⚫️⚪️\n",
Exemplo n.º 13
0
from telethon import events
from ub import bot as javes
import asyncio
#BY Sh1vam Dont try to kang
from ub.utils import admin_cmd

@javes.on(admin_cmd("holi"))
async def _(event):
    if event.fwd_from:
        return
    animation_interval = 3
    animation_ttl = range(0,9)
    await event.edit('𝐻𝒶𝓅𝓅𝓎𝐻𝑜𝓁𝒾')
    animation_chars = [
        '[Happy Holy Once Again To All](https://telegra.ph/file/ee2a7df3bc0a3334194b0.jpg)',
        '[­](https://telegra.ph/file/2e4ca1bc7f747858fe98d.jpg)',
        '[ㅤ­](https://telegra.ph/file/7f842a8f3aba51b8d5ac7.jpg)',
        '[­ㅤ](https://telegra.ph/file/f24efadcd212d996bb937.jpg)',
        '[ㅤ](https://telegra.ph/file/97b713907cd99f6831932.jpg)',
        '[🎨](https://telegra.ph/file/0b604517d37fc519f16b6.jpg)',
        '[❣️](https://telegra.ph/file/aaadc0e87f78be44cfdaa.jpg)',
        '[❣️🎨ㅤ­](https://telegra.ph/file/d7d62ebbff4b5b092d4e0.jpg)',
        ]
    for i in animation_ttl:
        	
        await asyncio.sleep(animation_interval)
        await event.edit(animation_chars[i % 8],link_preview=True)

        
            
Exemplo n.º 14
0
from PIL import Image
import sys
import os
from ub.utils import admin_cmd
from ub import bot 
from ub import bot as borg
if not os.path.isdir("./thug/"):
    os.makedirs("./thug/")

#made by  @THE_B_LACK_HAT Some errors solved by Sh1vam

@bot.on(admin_cmd(pattern=r"thug"))
async def scan(event):
    path = "thug"
     
    kk = await event.delete()

    reply = await event.get_reply_message()
    
    lol = await borg.download_media(reply.media, path)

    import cv2

    img = cv2.VideoCapture(lol) 
    tales, miraculous = img.read()
    
    os.system('wget https://telegra.ph/file/2369a71cc9c8b47a85735.png')

    imagePath = cv2.imwrite("shivam.jpg", miraculous)
    
    maskPath = "2369a71cc9c8b47a85735.png"
Exemplo n.º 15
0
from ub import bot as javes
from telethon import events

import asyncio

from ub.utils import admin_cmd


@javes.on(admin_cmd("evil"))
async def _(event):
    if event.fwd_from:
        return
    animation_interval = 3
    animation_ttl = range(
        0,
        10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    )
    await event.edit("EVIL IS WAKE UP...HA...HA...HA ... !!!")
    animation_chars = [
        "😈",
        "👿",
    ]

    for i in animation_ttl:

        await asyncio.sleep(animation_interval)
        await event.edit(animation_chars[i % 2])
Exemplo n.º 16
0
#Ported from Nana remix by @buddhhu
#imported admin_cmd for DC by @hellboi_atul
import pygments, os, asyncio
from pygments.lexers import Python3Lexer
from pygments.formatters import ImageFormatter
from ub.utils import admin_cmd
from ub import bot as borg


@borg.on(admin_cmd(pattern="pcode ?(.*)"))
async def coder_print(event):
    cmd = event.text
    a = await event.get_reply_message()
    coder = ""
    if len(cmd) > 7:
        coder = " ".join(cmd[7:])
    elif event.reply_to_msg_id and len(cmd) == 6:
        coder = a.message
    elif len(cmd) == 6:
        await event.reply("`No text Given`")
        await asyncio.sleep(2)
        await event.delete()
        return
    pygments.highlight(
        f"{coder}", Python3Lexer(),
        ImageFormatter(font_name="DejaVu Sans Mono", line_numbers=True),
        "out.png")
    await event.client.send_file(event.chat_id,
                                 "out.png",
                                 force_document=False)
    await event.delete()
Exemplo n.º 17
0
import os
#MADE BY SHIVAM DONT KANG
import cv2
from ub import CMD_HELP
#MADE BY SHIVAM DONT KANG
#MADE BY SHIVAM DONT KANG
from telegraph import upload_file
from telethon.tl.types import MessageMediaPhoto
from ub.utils import admin_cmd
from ub import bot 
from ub import bot as borg
import os , shutil


@borg.on(admin_cmd(pattern=r"gpic"))
async def hmm(event):

    await event.delete()
    linc = event.text
    links=linc[6:]
    text1,colors,text2=links.split("|")
    a,b,c=colors.split(";")
    window_name = 'Made By Shivam'
    image = cv2.imread("google.jpg") 
    font = cv2.FONT_HERSHEY_SIMPLEX
    org1 = (255,65)
    org2 = (450,280)
    color = (int(a),int(b),int(c))
    thickness=2
    fontScale=1
    image = cv2.putText(image, text1, org1, font, fontScale,  
Exemplo n.º 18
0
import numpy as np
import requests, os, re
from PIL import Image
from telegraph import upload_file
from telethon.tl.types import MessageMediaPhoto
from ub.utils import admin_cmd
from ub import bot
#DONOT KANG
from ub import bot as borg
#made by Sh1vam & @danish_00
path = "./dcobra/"
if not os.path.isdir(path):
    os.makedirs(path)


@borg.on(admin_cmd(pattern=r"wast"))
async def hmm(event):
    reply = await event.get_reply_message()
    await event.delete()
    #os.system(f'wget https://telegra.ph/file/26d43e25cb2095a931ab1.jpg')
    os.system(f'wget https://telegra.ph/file/b3a6038bc825cc4edc4f0.png')
    img = await borg.download_media(reply.media, path)

    mon = "b3a6038bc825cc4edc4f0.png"
    foreground = Image.open(mon).convert("RGBA")
    img = cv2.VideoCapture(img)
    tales, miraculous = img.read()
    cv2.imwrite("MiraculousLadybug.png", miraculous)
    shvm = PIL.Image.open("MiraculousLadybug.png")
    shi, vam = shvm.size
    img = shvm.resize((512, 512))
Exemplo n.º 19
0
from PIL import Image
import sys
import os
from ub.utils import admin_cmd
from ub import bot
from ub import bot as borg
if not os.path.isdir("./thug/"):
    os.makedirs("./thug/")

#made by  @THE_B_LACK_HAT Some errors solved by Sh1vam


@bot.on(admin_cmd(pattern=r"cthug"))
async def scan(event):
    path = "thug"

    kk = await event.delete()

    reply = await event.get_reply_message()

    lol = await borg.download_media(reply.media, path)

    import cv2

    img = cv2.VideoCapture(lol)
    tales, miraculous = img.read()

    os.system('wget https://telegra.ph/file/2369a71cc9c8b47a85735.png')

    imagePath = cv2.imwrite("shivamcat.jpg", miraculous)
Exemplo n.º 20
0
#Made BY Sh1vam
import datetime

from telethon import events

from telethon.errors.rpcerrorlist import YouBlockedUserError

from telethon.tl.functions.account import UpdateNotifySettingsRequest

from ub.utils import admin_cmd
from ub import bot as javes


@javes.on(admin_cmd(pattern="tgscan ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    reply_message = await event.get_reply_message()
    chat = "tgscanrobot"
    sender = reply_message.sender.id
    if reply_message.sender.bot:
        await event.edit("```Reply to actual users message.```")
        return
    await event.edit("```Checking...```")
    async with event.client.conversation(chat) as conv:
        try:
            response1 = conv.wait_event(
                events.NewMessage(incoming=True, from_users=1557162396))
            #response2 = conv.wait_event(events.NewMessage(incoming=True,from_users=1557162396))
            #response3 = conv.wait_event(events.NewMessage(incoming=True,from_users=1557162396))
            await conv.send_message("{}".format(sender))
Exemplo n.º 21
0
import os

from ub import CMD_HELP
from ub.utils import admin_cmd

from ub import bot as borg


@borg.on(admin_cmd(pattern=r"reveal", outgoing=True))
async def _(event):
    b = await event.client.download_media(await event.get_reply_message())
    a = open(b, "r")
    c = a.read()
    a.close()
    a = await event.reply("Reading file...")
    if len(c) > 4095:
        await a.edit(
            "The Total words in this file is more than telegram limits.")
    else:
        await event.client.send_message(event.chat_id, f"{c}")
        await a.delete()
    os.remove(b)


CMD_HELP.update({
    "reveal":
    ".reveal <reply to a file>\nUse - Read contents of file and send as a telegram message."
})
Exemplo n.º 22
0
from datetime import datetime

import requests
from bs4 import BeautifulSoup
from PIL import Image
from search_engine_parser import GoogleSearch

from ub.utils import admin_cmd, errors_handler
from ub import BOTLOG, BOTLOG_CHATID, CMD_HELP, bot
from ub import bot as borg
opener = urllib.request.build_opener()
useragent = "Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36"
opener.addheaders = [("User-agent", useragent)]


@borg.on(admin_cmd(outgoing=True, pattern=r"gs (.*)"))
async def gsearch(q_event):
    catevent = await q_event.edit("`searching........`")
    match = q_event.pattern_match.group(1)
    page = re.findall(r"page=\d+", match)
    try:
        page = page[0]
        page = page.replace("page=", "")
        match = match.replace("page=" + page[0], "")
    except IndexError:
        page = 1
    search_args = (str(match), int(page))
    gsearch = GoogleSearch()
    gresults = await gsearch.async_search(*search_args)
    msg = ""
    for i in range(len(gresults["links"])):
Exemplo n.º 23
0
#port to DARK COBRA by @hellboi-atul

import datetime
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from ub import bot, CMD_HELP
from ub.utils import admin_cmd
from ub import bot as borg


@borg.on(admin_cmd(pattern=r"qbot(?: |$)(.*)"))
async def _(event):
    if event.fwd_from:
        return
    if not event.reply_to_msg_id:
        await event.edit("```Reply to any user message.```")
        return
    reply_message = await event.get_reply_message()

    chat = "@QuotLyBot"
    sender = reply_message.sender
    if reply_message.sender.bot:
        await event.edit("```Reply to actual users message.```")
        return
    await event.edit("```Making a Quote```")
    async with bot.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=1031952739))
            await bot.forward_messages(chat, reply_message)
Exemplo n.º 24
0
import PIL
from ub.utils import admin_cmd
from ub import CMD_HELP
# ascii characters used to build the output text
import pygments, os, asyncio
from pygments.lexers import Python3Lexer
from pygments.formatters import ImageFormatter
from ub.utils import admin_cmd
from ub import bot
from ub import bot as borg


@bot.on(admin_cmd(pattern="art ?(.*)", outgoing=True))
# DONOT KANG by @THE_B_LACK_HAT & Sh1vam
async def __(event):

    path = "dck"
    await event.delete()
    reply = await event.get_reply_message()

    down = await borg.download_media(reply.media, path)

    ASCII_CHARS = ["@", "#", "S", "%", "?", "*", "+", ";", ":", ",", "."]

    # resize image according to a new width
    def resize_image(image, new_width=100):
        width, height = image.size
        #reference_length = max(width, height)
        #ratio = 512 / reference_length
        ratio = height / width
        new_height = int(new_width * ratio)
Exemplo n.º 25
0
#by Sh1vam
#Kangers stay away

import os
from ub import bot as javes
import subprocess, os, asyncio, shutil
from ub.utils import admin_cmd


@javes.on(admin_cmd("tgsjson"))
async def messup(message):
    await message.edit("`jsoning....`")
    reply = await message.get_reply_message()
    stkr = await reply.download_media("tgs.tgs")
    process = await asyncio.create_subprocess_shell(
        f"lottie_convert.py {stkr} json.json",
        stdout=asyncio.subprocess.PIPE,
        stderr=asyncio.subprocess.PIPE)
    stdout, stderr = await process.communicate()
    os.remove(stkr)
    if message.reply_to_msg_id:
        message_id = message.reply_to_msg_id

    await message.client.send_file(message.chat_id,
                                   "json.json",
                                   force_document=False,
                                   reply_to=message_id)
    os.remove("json.json")

    await message.delete()
Exemplo n.º 26
0
# By @Danish_00
# Fixed By a NOOB
# Made for DARK COBRA by team Cobra..
# kang with credits do not edit these lines..

from telethon.tl.types import MessageMediaPhoto
import os, urllib, requests, asyncio
from ub.utils import admin_cmd
from ub import CMD_HELP
from ub import bot as borg
DARKCOBRA = "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"


@borg.on(admin_cmd(pattern="toonify$", outgoing=True))
async def _(event):

    reply = await event.get_reply_message()
    if not reply:  #By @Danish_00
        #Fixed By a NOOB
        return await event.edit("Reply to any image or non animated sticker !")
    devent = await event.edit("Downloading the file😅😁😁....")
    media = await event.client.download_media(reply)
    if not media.endswith(("png", "jpg", "webp")):
        return await event.edit("Reply to any image or non animated sticker !"
                                )  #By @Danish_00
#Fixed By a NOOB
    devent = await event.edit("Toonifying image 🤪🤣🤓...")  #hehehhehehhe
    r = requests.post(
        "https://api.deepai.org/api/toonify",
        files={
            "image": open(media, "rb"),
Exemplo n.º 27
0
#by Shlbvam
#Kangers stay away
import os
from ub import bot as javes
import subprocess, os, asyncio, shutil
from ub.utils import admin_cmd


@javes.on(admin_cmd("stgsmagic"))
async def messup(message):

    await message.edit("`messing....`")
    miraculous = message.text
    tales = miraculous[11:]
    ladybug, lb, catnoir, cn = tales.split(";")
    a, lb, b, cn = float(ladybug), float(lb), float(catnoir), float(cn)

    c, d = a + lb, b + cn
    e, f = c + lb, d + cn
    g, h = e + lb, f + cn
    i, j = g + lb, h + cn
    reply = await message.get_reply_message()
    stkr = await reply.download_media("tgs.tgs")
    process = await asyncio.create_subprocess_shell(
        f"lottie_convert.py {stkr} json.json",
        stdout=asyncio.subprocess.PIPE,
        stderr=asyncio.subprocess.PIPE)
    stdout, stderr = await process.communicate()
    os.remove(stkr)
    if message.reply_to_msg_id:
        message_id = message.reply_to_msg_id
Exemplo n.º 28
0
#PORTED TO JAVES BY SH1VAM
#modified to get translations in any language
import asyncio
import os
from re import match
import asyncio
import aiofiles
from selenium import webdriver
from ub import bot as javes
from ub.javes_main.heroku_var import Config
from ub.utils import admin_cmd
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager


@javes.on(admin_cmd("trlte"))
async def webss(message):
    shiva = message.text
    shivam = shiva[7:]
    langcode, text = shivam.split(";")

    link = f"https://translate.google.com/?sl=auto&tl={langcode}&text={text}&op=translate"
    await message.edit("`Processing ...`")

    chrome_options = webdriver.ChromeOptions()
    chrome_options.binary_location = Config.GOOGLE_CHROME_BIN
    chrome_options.add_argument("--ignore-certificate-errors")
    chrome_options.add_argument("--test-type")
    chrome_options.add_argument("--headless")
    chrome_options.add_argument("--no-sandbox")
    chrome_options.add_argument("--disable-dev-shm-usage")
Exemplo n.º 29
0
import os

import pybase64
from telegraph import exceptions, upload_file
from telethon.tl.functions.messages import ImportChatInviteRequest as Get
from ub import bot
from ub import CMD_HELP
from ub.utils import admin_cmd
from ub.helpers import *


@bot.on(admin_cmd(pattern="lolice(?: |$)(.*)"))
async def lolce(smss):
    replied = await smss.get_reply_message()
    if not os.path.isdir("./temp/"):
        os.makedirs("./temp/")
    if not replied:
        await smss.edit("reply to a supported media file")
        return
    if replied.media:
        smss = await smss.edit("passing to telegraph...")
    else:
        await smss.edit("reply to a supported media file")
        return
    download_locatnoarion = await smss.client.download_media(
        replied, "./temp/")
    if download_locatnoarion.endswith((".webp")):
        download_locatnoarion = convert_toimage(download_locatnoarion)
    size = os.stat(download_locatnoarion).st_size
    if download_locatnoarion.endswith(
        (".jpg", ".jpeg", ".png", ".bmp", ".ico")):
Exemplo n.º 30
0
import PIL
from ub.utils import admin_cmd
from ub import CMD_HELP
import pygments, os, asyncio
from pygments.lexers import Python3Lexer
from pygments.formatters import ImageFormatter
from ub.utils import admin_cmd
from ub import bot
from ub import bot as borg
@bot.on(admin_cmd(pattern="size ?(.*)", outgoing=True))
# DONOT KANG by Sh1vam
async def __(event):
    
    path = "shivamdownloadesimg"

    reply = await event.get_reply_message()
        
    download = await borg.download_media(reply.media, path)
    image = PIL.Image.open(download)
    shvm=PIL.Image.open(download)
    shi,vam = image.size
    #img=shvm.resize((int(sh1),int(vam)))
    await event.edit(f"Dimensions Of Image are {shi} by {vam}")
    os.remove(download)
@bot.on(admin_cmd(pattern="iresize ?(.*)", outgoing=True))
# DONOT KANG by Sh1vam
async def __(event):
    
    path = "shivamdownloades"
    licence = event.text
    liscence=licence[8:]