Exemplo n.º 1
0
from telethon import events
from REBELBOT.utils import admin_cmd

normiefont = [
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
    'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
]
circlefont = [
    'a⃠', 'b⃠', 'c⃠', 'd⃠', 'e⃠', 'f⃠', 'g⃠', 'h⃠', 'i⃠', 'j⃠', 'k⃠', 'l⃠',
    'm⃠', 'n⃠', 'o⃠', 'p⃠', 'q⃠', 'r⃠', 's⃠', 't⃠', 'u⃠', 'v⃠', 'w⃠', 'x⃠',
    'y⃠', 'z⃠'
]


@borg.on(admin_cmd(pattern="bfc ?(.*)"))
async def weebify(event):

    args = event.pattern_match.group(1)
    if not args:
        get = await event.get_reply_message()
        args = get.text
    if not args:
        await event.edit("`give me a text `")
        return
    string = '  '.join(args).lower()
    for normiecharacter in string:
        if normiecharacter in normiefont:
            circlecharacter = circlefont[normiefont.index(normiecharacter)]
            string = string.replace(normiecharacter, circlecharacter)
    await event.edit(string)
Exemplo n.º 2
0
import os
from faker import Faker
import datetime
from telethon import functions, types, events
from telethon.tl.functions.messages import DeleteHistoryRequest
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest

from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from REBELBOT import CmdHelp, bot as REBELBOT


@REBELBOT.on(admin_cmd("gencc$"))
@REBELBOT.on(sudo_cmd("gencc$", allow_sudo=True))
async def _(REBELevent):
    if REBELevent.fwd_from:
        return
    REBELcc = Faker()
    REBELname = REBELcc.name()
    REBELadre = REBELcc.address()
    REBELcard = REBELcc.credit_card_full()

    await edit_or_reply(
        REBELevent,
        f"__**👤 NAME :- **__\n`{REBELname}`\n\n__**🏡 ADDRESS :- **__\n`{REBELadre}`\n\n__**💸 CARD :- **__\n`{REBELcard}`"
    )


@REBELBOT.on(admin_cmd(pattern="bin ?(.*)"))
@REBELBOT.on(sudo_cmd(pattern="bin ?(.*)", allow_sudo=True))
async def _(event):
Exemplo n.º 3
0
# credits: @Mr_Hops

from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError

from userbot import CMD_HELP
from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="recognize ?(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="recognize ?(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    if not event.reply_to_msg_id:
        await edit_or_reply(event, "Reply to any user's media message.")
        return
    reply_message = await event.get_reply_message()
    if not reply_message.media:
        await edit_or_reply(event, "reply to media file")
        return
    chat = "@Rekognition_Bot"
    reply_message.sender
    if reply_message.sender.bot:
        await edit_or_reply(event, "Reply to actual users message.")
        return
    REBEL = await edit_or_reply(event, "recognizeing this media")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
Exemplo n.º 4
0
from telethon import events, utils
from telethon.tl import types
from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp
from userbot.plugins.sql_helper.filter_sql import get_filter, add_filter, remove_filter, get_all_filters, remove_all_filters

DELETE_TIMEOUT = 0
TYPE_TEXT = 0
TYPE_PHOTO = 1
TYPE_DOCUMENT = 2

global last_triggered_filters
last_triggered_filters = {}  # pylint:disable=E0602


@bot.on(admin_cmd(incoming=True))
async def on_snip(event):
    global last_triggered_filters
    name = event.raw_text
    if event.chat_id in last_triggered_filters:
        if name in last_triggered_filters[event.chat_id]:
            # avoid userbot spam
            # "I demand rights for us bots, we are equal to you humans." -Henri Koivuneva (t.me/UserbotTesting/2698)
            return False
    snips = get_all_filters(event.chat_id)
    if snips:
        for snip in snips:
            pattern = r"( |^|[^\w])" + re.escape(snip.keyword) + r"( |$|[^\w])"
            if re.search(pattern, name, flags=re.IGNORECASE):
                if snip.snip_type == TYPE_PHOTO:
                    media = types.InputPhoto(int(snip.media_id),
Exemplo n.º 5
0
import requests

from userbot import CMD_HELP
from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="dns (.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="dns (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    sample_url = "https://da.gd/dns/{}".format(input_str)
    response_api = requests.get(sample_url).text
    if response_api:
        await edit_or_reply(
            event, "DNS records of [This link]({}) are \n{}".format(
                input_str, response_api, link_preview=False))
    else:
        await edit_or_reply(
            event,
            "i can't seem to find [this link]({}) on the internet".format(
                input_str, link_preview=False))


@bot.on(admin_cmd(pattern="url (.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="url (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
Exemplo n.º 6
0
.shutdown"""
# This Source Code Form is subject to the terms of the GNU
# General Public License, v.3.0. If a copy of the GPL was not distributed with this
# file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html
import os
import sys
import asyncio
from os import execl
from time import sleep

from REBELBOT.utils import admin_cmd
from userbot.cmdhelp import CmdHelp
from userbot import HEROKU_APP, bot


@bot.on(admin_cmd(pattern="restart"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit(
        "Restarting **[ ░░░ ]** ...\nType `.ping` or `.help` to check if I am working 🙂"
    )
    await event.edit(
        "Restarting **[ █░░ ]** ...\nType `.ping` or `.help` to check if I am working 🙂"
    )
    await event.edit(
        "Restarting **[ ██░ ]** ...\nType `.ping` or `.help` to check if I am working 🙂"
    )
    await event.edit(
        "Restarting **[ ███ ]** ...\nType `.ping` or `.help` to check if I am working 🙂"
    )
Exemplo n.º 7
0
"""

from os import remove
from random import choice
from urllib import parse

import requests

from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp

BASE_URL = "https://headp.at/pats/{}"
PAT_IMAGE = "pat.jpg"


@bot.on(admin_cmd(pattern="pat ?(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="pat ?(.*)", allow_sudo=True))
async def lastfm(event):
    if event.fwd_from:
        return
    username = event.pattern_match.group(1)
    if not username and not event.reply_to_msg_id:
        await edit_or_reply(event, "`Reply to a message or provide username`")
        return

    resp = requests.get("http://headp.at/js/pats.json")
    pats = resp.json()
    pat = BASE_URL.format(parse.quote(choice(pats)))
    await event.delete()
    with open(PAT_IMAGE, "wb") as f:
        f.write(requests.get(pat).content)
Exemplo n.º 8
0
    img.save(filename, "jpeg")
    os.remove(image)
    return filename


def convert_tosticker(response, filename=None):
    filename = filename or os.path.join("./temp/", "temp.webp")
    image = Image.open(response)
    if image.mode != "RGB":
        image.convert("RGB")
    image.save(filename, "webp")
    os.remove(response)
    return filename


@bot.on(admin_cmd(pattern="(rmbg|srmbg) ?(.*)"))
@bot.on(sudo_cmd(pattern="(rmbg|srmbg) ?(.*)", allow_sudo=True))
async def remove_background(event):
    if Config.REM_BG_API_KEY is None:
        return await edit_or_reply(
            event,
            "You have to set `REM_BG_API_KEY` in Config vars with API token from remove.bg to use this module"
        )
    cmd = event.pattern_match.group(1)
    input_str = event.pattern_match.group(2)
    message_id = await reply_id(event)
    if event.reply_to_msg_id and not input_str:
        reply_message = await event.get_reply_message()
        REBELevent = await edit_or_reply(event, "`Analysing...`")
        file_name = os.path.join(TEMP_DIR, "rmbg.png")
        try:
Exemplo n.º 9
0
import asyncio
import hashlib
import json
import os
import time
from datetime import datetime

import aiohttp
import magic
import requests
from REBELBOT.utils import admin_cmd, progress, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="verystream ?(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="verystream ?(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    mone = await edit_or_reply(event, "Processing ...")
    if Config.VERY_STREAM_LOGIN is None or Config.VERY_STREAM_KEY is None:
        await mone.edit(
            "This module requires API key from https://verystream.com. Aborting!"
        )
        return False
    input_str = event.pattern_match.group(1)
    if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY):
        os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY)
    required_file_name = None
    start = datetime.now()
Exemplo n.º 10
0
"""
from telethon import events

import asyncio

import os

import sys

import random

from REBELBOT.utils import admin_cmd


@borg.on(admin_cmd(pattern=f"tip", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    await event.edit("Well, let me give you a life-pro tip... 😉")
    await asyncio.sleep(2)
    x = (random.randrange(1, 87))
    if x == 1:
        await event.edit(
            "`\"Before telling your landlord you're moving, ask them to fix anything broken that you're worried you might get charged for. They often will, and then when you move out they won't be able to take it out of your security deposit.\"`"
        )
    if x == 2:
        await event.edit(
            "`\"Walking before solving a problem improves your creativity by an average of 60%.\"`"
        )
    if x == 3:
Exemplo n.º 11
0
from userbot import CMD_HELP
from userbot.helpers.functions import (
    convert_toimage,
    deEmojify,
    phcomment,
    threats,
    trap,
    trash,
)
from REBELBOT.utils import admin_cmd, edit_or_reply, sudo_cmd
from userbot.cmdhelp import CmdHelp
from . import *


@bot.on(admin_cmd(pattern="threats(?: |$)(.*)"))
@bot.on(sudo_cmd(pattern="threats(?: |$)(.*)", allow_sudo=True))
async def REBELBOT(REBELmemes):
    replied = await REBELmemes.get_reply_message()
    if not os.path.isdir("./temp/"):
        os.makedirs("./temp/")
    if not replied:
        await edit_or_reply(
            REBELmemes,
            "`Media file not supported. Reply to a supported media`")
        return
    if replied.media:
        REBELmemmes = await edit_or_reply(REBELmemes,
                                          "`Detecting Threats.........`")
    else:
        await edit_or_reply(
Exemplo n.º 12
0
            await event.reply("`Channel or supergroup doesn't exist`")
            return None
        except (TypeError, ValueError):
            await event.reply("`Invalid channel/group`")
            return None
    return chat_info


def user_full_name(user):
    names = [user.first_name, user.last_name]
    names = [i for i in list(names) if i]
    full_name = " ".join(names)
    return full_name


@bot.on(admin_cmd(pattern="inviteall ?(.*)"))
@bot.on(sudo_cmd(pattern="inviteall ?(.*)", allow_sudo=True))
async def get_users(event):
    sender = await event.get_sender()
    me = await event.client.get_me()
    if not sender.id == me.id:
        REBEL = await edit_or_reply(event, "`processing...`")
    else:
        REBEL = await edit_or_reply(event, "`processing...`")
    kraken = await get_chatinfo(event)
    chat = await event.get_chat()
    if event.is_private:
        return await REBEL.edit("`Sorry, Cant add users here`")
    s = 0
    f = 0
    error = "None"
Exemplo n.º 13
0
# credits to @mrconfused
import io
import sys
import traceback

from userbot import CMD_HELP
from REBELBOT.utils import admin_cmd, edit_or_reply, sudo_cmd
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="calc (.*)"))
@bot.on(sudo_cmd(pattern="calc (.*)", allow_sudo=True))
async def _(car):
    if car.fwd_from:
        return
    cmd = car.text.split(" ", maxsplit=1)[1]
    event = await edit_or_reply(car, "Calculating ...")
    old_stderr = sys.stderr
    old_stdout = sys.stdout
    redirected_output = sys.stdout = io.StringIO()
    redirected_error = sys.stderr = io.StringIO()
    stdout, stderr, exc = None, None, None
    san = f"print({cmd})"
    try:
        await aexec(san, event)
    except Exception:
        exc = traceback.format_exc()
    stdout = redirected_output.getvalue()
    stderr = redirected_error.getvalue()
    sys.stdout = old_stdout
    sys.stderr = old_stderr
Exemplo n.º 14
0
import asyncio
from collections import deque

from userbot import *
from REBELBOT.utils import admin_cmd, edit_or_reply, sudo_cmd
from userbot.cmdhelp import CmdHelp

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "REBEL User"


@bot.on(admin_cmd(pattern=r"boxs$", outgoing=True))
@bot.on(sudo_cmd(pattern=r"boxs$", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    event = await edit_or_reply(event, "`boxs...`")
    deq = deque(list("🟥🟧🟨🟩🟦🟪🟫⬛⬜"))
    for _ in range(999):
        await asyncio.sleep(0.3)
        await event.edit("".join(deq))
        deq.rotate(1)


@bot.on(admin_cmd(pattern=r"rain$", outgoing=True))
@bot.on(sudo_cmd(pattern=r"rain$", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    event = await edit_or_reply(event, "`Raining.......`")
    deq = deque(list("🌬☁️🌩🌨🌧🌦🌥⛅🌤"))
    for _ in range(48):
Exemplo n.º 15
0
import asyncio

from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="phub$", outgoing=True))
@bot.on(sudo_cmd(pattern="phub$", allow_sudo=True))
async def _(event):

    if event.fwd_from:

        return

    animation_interval = 0.5

    animation_ttl = range(0, 101)

    await edit_or_reply(event, "phub")

    animation_chars = [
        "P_",
        "PO_",
        "POR_",
        "PORN_",
        "PORNH_",
        "PORNHU_",
        "PORNHUB_",
        "PORNHUB",
    ]
Exemplo n.º 16
0
from telethon import events
import asyncio
import os
import sys
import random
from REBELBOT.utils import admin_cmd

@borg.on(admin_cmd(pattern="byeq ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit("@veryhelpful making goodbye quote")
    await asyncio.sleep(1)
    g=(random.randrange(1,18))
    if g==1:
        await event.edit(" जिंदगी में तन्हा रहना तो मुमकिन नहीं,\nतेरे साथ चलना दुनिया को गवारा भी नहीं,\nइसलिए, तेरा-मेरा दूर जाना ही बेहतर है।")
    if g==2:
        await event.edit("कुछ दिन साथ चलने वाले,\nथोड़ा और साथ चलने की तमन्ना थी,\nमजबूरी है कहना ही पड़ेगा अलविदा।")#creadit to kraken,sawan
    if g==3:
        await event.edit("न कहा न कुछ सुना, बस चुपके से चल दिए,\nमोहब्बत के उन्होंने सारे मायने बदल दिए,\अब तो तन्हा गलियों में गुजरेगी हर शाम,\nमर भी गए, तो भी नहीं भूलेंगे उनका नाम।")
    if g==4:
        await event.edit("पास थे, तो रोने की वजह बनते थे,\nदूर जाकर शायद मुस्कुराना सीख लें आप।")
    if g==5:
        await event.edit("दोबारा मिलें जिंदगी में यह दुआ करेंगे,\nदूर रहकर भी नजदीक होने की चाह करेंगे।")#creadit to kraken,sawan
    if g==6:
        await event.edit("माफ करना मुझे दूर तो जाना पड़ेगा,\nपास होकर भी तुम्हे अब भूल जाना पड़ेगा।")#creadit to kraken,sawan
    if g==7:
        await event.edit("वो शाम सुहानी थी जो गुजरी तेरे साथ,\nबिन तेरे अब कैसे कटेगी सारी रात,\nसमझ लो तुम भी यह मजबूरी है दिल की,\nनहीं गए, तो कैसे कल फिर होगी मुलाकात।")#creadit to kraken,sawan
    if g==8:
        await eventt.edit("तेरे साथ मुस्कुराना और ठोकरों से संभलना सीखा है,\nआता नहीं अलविदा कहना बस रोकर जताना सीखा है।")
    if g==9:
Exemplo n.º 17
0
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇",
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆[🎁](https://github.com/REBEL725/REBELBOT)🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇",
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆[🎁](https://github.com/REBEL725/REBELBOT)🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇",
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇[🎁](https://github.com/REBEL725/REBELBOT)🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇",
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆[🎁](https://github.com/REBEL725/REBELBOT)🎆\n🎇🎆🎇🎆🎇🎆🎇",
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n[🎁](https://github.com/REBEL725/REBELBOT)🎆🎇🎆🎇🎆🎇",
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇[🎁](https://REBEL725/REBELBOT)\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆",
            "🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇🎆\n🎇🎆🎇🎆🎇🎆🎇\n🎆🎇🎆🎇🎆🎇\n🎇🎆🎇🎆🎇🎆🎇",
            "**Game Over**",
        ]
        for i in animation_ttl:
            await asyncio.sleep(animation_interval)
            await event.edit(animation_chars[i % 14])


@bot.on(admin_cmd(pattern="xogame$", outgoing=True))
@bot.on(sudo_cmd(pattern="xogame$", allow_sudo=True))
async def gamez(event):
    if event.fwd_from:
        return
    botusername = "******"
    noob = "play"
    if event.reply_to_msg_id:
        await event.get_reply_message()
    tap = await bot.inline_query(botusername, noob)
    await tap[0].click(event.chat_id)
    await event.delete()

CmdHelp("games").add_command(
  "xogame", None, "Lets play a game bruh. X-O Game iz here🔥"
).add()
Exemplo n.º 18
0
    elif hasattr(obj, "__iter__"):
        # display iterables one after another at the base indentation level
        result.append("\n")
        indent += 2
        for x in obj:
            result.append(" " * indent)
            result.append(yaml_format(x, indent))
            result.append("\n")
        result.pop()
        indent -= 2
        result.append(" " * indent)
    else:
        result.append(repr(obj))

    return "".join(result)


@bot.on(admin_cmd(pattern=r"new", outgoing=True))
@bot.on(sudo_cmd(pattern=r"new", allow_sudo=True))
async def _(event):
    if not event.message.is_reply:
        return
    msg = await event.message.get_reply_message()
    yaml_text = yaml_format(msg)
    await edit_or_reply(event, yaml_text, parse_mode=parse_pre)


CmdHelp("new").add_command(
    "new", None,
    "Pretty formats the given object as a YAML string which is returned.(based on TLObject.pretty_format)"
).add()
Exemplo n.º 19
0
    f = f.findall(pc)

    fy = "http://getwallpapers.com" + random.choice(f)

    print(fy)

    if not os.path.exists("f.ttf"):

        urllib.request.urlretrieve(
            "https://github.com/rebel6969/mym/raw/master/Rebel-robot-Regular.ttf",
            "f.ttf")

    urllib.request.urlretrieve(fy, "donottouch.jpg")


@borg.on(admin_cmd(pattern="adshiv ?(.*)"))
async def main(event):

    await event.edit(
        "**Starting shiv Profile Pic...\n\nDone !!! Check Your DP. Made by @veryhelpful"
    )

    while True:

        await animepp()

        file = await event.client.upload_file("donottouch.jpg")

        await event.client(functions.photos.UploadProfilePhotoRequest(file))

        os.system("rm -rf donottouch.jpg")
Exemplo n.º 20
0
import asyncio

from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="undlt"))
@bot.on(sudo_cmd(pattern="undlt", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    c = await event.get_chat()
    if c.admin_rights or c.creator:
        a = await borg.get_admin_log(event.chat_id,
                                     limit=5,
                                     search="",
                                     edit=False,
                                     delete=True)
        for i in a:
            await event.reply(i.original.action.message)
    else:
        await edit_or_reply(
            event,
            "You need administrative permissions in order to do this command")
        await asyncio.sleep(3)
        await event.delete()


CmdHelp("undlt").add_command(
    "undlt", None,
    "Sends 5 recently deleted message from that group. Requires admin position"
Exemplo n.º 21
0
    deEmojify,
    kannagen,
    miatweet,
    moditweet,
    papputweet,
    sinstweet,
    sunnytweet,
    taklatweet,
    trumptweet,
    dani,
)
from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern=r"tweet(?: |$)(.*)"))
@bot.on(sudo_cmd(pattern="tweet(?: |$)(.*)", allow_sudo=True))
async def nope(kraken):
    REBEL = kraken.pattern_match.group(1)
    if not REBEL:
        if kraken.is_reply:
            (await kraken.get_reply_message()).message
        else:
            await edit_or_reply(kraken, "I need some text to make a tweet🚶")
            return
    tweeter = await bot.inline_query("TwitterStatusBot",
                                     f"{(deEmojify(REBEL))}")
    await tweeter[0].click(
        kraken.chat_id,
        reply_to=kraken.reply_to_msg_id,
        silent=True if kraken.is_reply else False,
Exemplo n.º 22
0
"""Fun pligon...for userbot
\nCode by @veryhelpful
type `.evilmsg` and to see the fun.
"""
import random, re
from REBELBOT.utils import admin_cmd
import asyncio
from telethon import events


@borg.on(admin_cmd(pattern="hmsg ?(.*)"))
async def _(event):
    if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@",
                                                             "!"):
        await event.edit(".\n\n.")
        await asyncio.sleep(0.1)
        await event.edit(
            ".\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n."
        )  #by @VERYHELPFUL
        await asyncio.sleep(0.1)
        await event.edit(".\n\n.")  #CREADIT kraken
        await asyncio.sleep(0.1)
        await event.edit(
            ".\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n."
        )  #if editing thhen add creadit
        await asyncio.sleep(0.1)
        await event.edit(".\n\n\n\n\n\n\n.")
        await asyncio.sleep(0.1)
        await event.edit(
            ".\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n."
        )  #copy paster without creadit r madharchod randi ke bache diont copy
Exemplo n.º 23
0
import os
from datetime import datetime

import requests

from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="stt (.*)"))
@bot.on(sudo_cmd(pattern="stt (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    start = datetime.now()
    input_str = event.pattern_match.group(1)
    if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY):
        os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY)
    REBELevent = await edit_or_reply(
        event, "Downloading to my local, for analysis  🙇")
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        required_file_name = await event.client.download_media(
            previous_message, Config.TMP_DOWNLOAD_DIRECTORY)
        lan = input_str
        if (Config.IBM_WATSON_CRED_URL is None
                or Config.IBM_WATSON_CRED_PASSWORD is None):
            await REBELevent.edit(
                "You need to set the required ENV variables for this module. \nModule stopping"
            )
        else:
Exemplo n.º 24
0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from asyncio import sleep
from telethon import events
import telethon.utils
from telethon.errors import rpcbaseerrors

from REBELBOT.utils import admin_cmd, sudo_cmd, errors_handler
from userbot import bot as REBELBOT
from userbot import BOTLOG, BOTLOG_CHATID


@REBELBOT.on(admin_cmd(outgoing=True, pattern="del$"))
@REBELBOT.on(sudo_cmd(allow_sudo=True, pattern="del$"))
@errors_handler
async def delete_it(safai):
    """ For .del command, delete the replied message. """
    msg_src = await safai.get_reply_message()
    if safai.reply_to_msg_id:
        try:
            await msg_src.delete()
            await safai.delete()
            if BOTLOG:
                await delme.client.send_message(
                    BOTLOG_CHATID, "#DEL \nDeletion of message was successful")
        except rpcbaseerrors.BadRequestError:
            if BOTLOG:
                await delme.client.send_message(
                    BOTLOG_CHATID, "Well, I can't delete a message")
Exemplo n.º 25
0
"""Take screenshot of any website
Syntax: .screenshot <Website URL>"""

import io
import traceback
from datetime import datetime

from selenium import webdriver

from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="screenshot (.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="screenshot (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    if Config.GOOGLE_CHROME_BIN is None:
        await edit_or_reply(event,
                            "need to install Google Chrome. Module Stopping.")
        return
    await edit_or_reply(event, "Processing ...weit")
    start = datetime.now()
    try:
        chrome_options = webdriver.ChromeOptions()
        chrome_options.add_argument("--ignore-certificate-errors")
        chrome_options.add_argument("--test-type")
        chrome_options.add_argument("--headless")
        # https://stackoverflow.com/a/53073789/4723940
        chrome_options.add_argument("--no-sandbox")
Exemplo n.º 26
0
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.b (the "License");
# you may not use this file except in compliance with the License.
#
# You can find misc modules, which dont fit in anything xD
""" Userbot module for other small commands. """

from random import randint
from time import sleep

from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp


@bot.on(admin_cmd(pattern="random", outgoing=True))
@bot.on(sudo_cmd(pattern="random", allow_sudo=True))
async def randomise(items):
    """ For .random command, get a random item from the list of items. """
    if not items.text[0].isalpha() and items.text[0] not in ("/", "#", "@",
                                                             "!"):
        itemo = (items.text[8:]).split()
        index = randint(1, len(itemo) - 1)
        await edit_or_reply(
            items, "**Query: **\n`" + items.text[8:] + "`\n**Output: **\n`" +
            itemo[index] + "`")


@bot.on(admin_cmd(pattern="sleep([0-9]+)?$", outgoing=True))
@bot.on(sudo_cmd(pattern="sleep([0-9]+)?$", allow_sudo=True))
async def sleepybot(time):
Exemplo n.º 27
0
# Credits to @spechide and his team for @TROLLVOICEBOT
# made by @h1m4n5hu0p_the_badass from the snippets of waifu AKA stickerizerbot....
# kang karega kya madarchod?
# aukaat h bsdk teri...jake baap ka loda chus ke aa....

import re

from userbot import bot
from REBELBOT.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp
from userbot.helpers.functions import deEmojify


@bot.on(admin_cmd(pattern="mev(?: |$)(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="mev(?: |$)(.*)", allow_sudo=True))
async def nope(h1m4n5hu0p):
    REBEL = h1m4n5hu0p.pattern_match.group(1)
    if not REBEL:
        if h1m4n5hu0p.is_reply:
            (await h1m4n5hu0p.get_reply_message()).message
        else:
            await edit_or_reply(
                h1m4n5hu0p,
                "`Sir please give some query to search and download it for you..!`"
            )
            return

    troll = await bot.inline_query("TrollVoiceBot", f"{(deEmojify(REBEL))}")

    await troll[0].click(
        h1m4n5hu0p.chat_id,
Exemplo n.º 28
0
import datetime

from telethon import events

from telethon.errors.rpcerrorlist import YouBlockedUserError

from telethon.tl.functions.account import UpdateNotifySettingsRequest

from REBELBOT.utils import admin_cmd


@borg.on(admin_cmd("ebook ?(.*)"))
async def _(event):

    if event.fwd_from:

        return

    if not event.reply_to_msg_id:

        await event.edit("Reply to any number.")

        return

    reply_message = await event.get_reply_message()

    if not reply_message.text:

        await event.edit("abe book ke name ko reply kar. ")

        return
Exemplo n.º 29
0
        "apikey": api_key,
        "language": language,
    }
    r = requests.post(
        "https://api.ocr.space/parse/image",
        data=payload,
    )
    return r.json()


def progress(current, total):
    logger.info("Downloaded {} of {}\nCompleted {}".format(
        current, total, (current / total) * 100))


@bot.on(admin_cmd(pattern="ocrlang", outgoing=True))
@bot.on(sudo_cmd(pattern="ocrlang", allow_sudo=True))
async def get_ocr_languages(event):
    if event.fwd_from:
        return
    languages = {}
    languages["English"] = "eng"
    languages["Arabic"] = "ara"
    languages["Bulgarian"] = "bul"
    languages["Chinese (Simplified)"] = "chs"
    languages["Chinese (Traditional)"] = "cht"
    languages["Croatian"] = "hrv"
    languages["Czech"] = "cze"
    languages["Danish"] = "dan"
    languages["Dutch"] = "dut"
    languages["Finnish"] = "fin"
Exemplo n.º 30
0
    "Ⓝ",
    "Ⓞ",
    "Ⓟ",
    "Ⓠ",
    "Ⓡ",
    "Ⓢ",
    "Ⓣ",
    "Ⓤ",
    "Ⓥ",
    "Ⓦ",
    "Ⓧ",
    "Ⓨ",
    "Ⓩ",
]

@bot.on(admin_cmd(pattern="weeb(?: |$)(.*)", command="weeb"))
@bot.on(sudo_cmd(pattern="weeb(?: |$)(.*)", command="weeb", allow_sudo=True))
async def weebify(event):
    if event.fwd_from:
        return
    args = event.pattern_match.group(1)
    if not args:
        get = await event.get_reply_message()
        args = get.text
    if not args:
        await edit_or_reply(event, "`What I am Supposed to Weebify U Dumb`")
        return
    string = "".join(args).lower()
    for normiecharacter in string:
        if normiecharacter in normiefont:
            weebycharacter = weebyfont[normiefont.index(normiecharacter)]