Пример #1
0
import os

from Extre import ALIVE_NAME, CMD_HELP, CMD_LIST
from Extre.config import Config
from Extre.utils import extremepro_cmd

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "EXTREMEPRO USER"
CMD_HNDLR = os.environ.get("CMD_HNDLR", None)
CUSTOM_HELP_EMOJI = os.environ.get("CUSTOM_HELP_EMOJI", "⚡")

if CMD_HNDLR is None:
    CMD_HNDLR = "."


@bot.on(extremepro_cmd(pattern="help ?(.*)"))
@bot.on(amanpandey_cmd(pattern="help ?(.*)", allow_sudo=True))
async def cmd_list(event):
    if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"):
        tgbotusername = Var.TG_BOT_USER_NAME_BF_HER
        input_str = event.pattern_match.group(1)
        if tgbotusername is None or input_str == "text":
            string = ""
            for i in CMD_HELP:
                string += CUSTOM_HELP_EMOJI + " " + i + " " + CUSTOM_HELP_EMOJI + "\n"
                for iter_list in CMD_HELP[i]:
                    string += "    `" + str(iter_list) + "`"
                    string += "\n"
                string += "\n"
            if len(string) > 4095:
                with io.BytesIO(str.encode(string)) as out_file:
                    out_file.name = "cmd.txt"
Пример #2
0
from pygments.formatters import ImageFormatter
from pygments.lexers import Python3Lexer
from requests import exceptions, get
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError


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


from Extre.utils import extremepro_cmd, amanpandey_cmd


@bot.on(extremepro_cmd(pattern="neko(?: |$)(.*)", outgoing=True))
@bot.on(amanpandey_cmd(pattern="neko(?: |$)(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    catevent = await edit_or_reply(event, "`Pasting to neko bin.....`")
    input_str = "".join(event.text.split(maxsplit=1)[1:])
    if input_str:
        message = input_str
        downloaded_file_name = None
    elif event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        if previous_message.media:
            downloaded_file_name = await event.client.download_media(
                previous_message,
                Config.TEMP_DIR,
Пример #3
0
from Extre import *
from Extre.utils import extremepro_cmd
from telethon.tl.types import ChannelParticipantsAdmins
from Extre import ALIVE_NAME, StartTime
from plugins import *
from Extre.utils import extremepro_cmd as extremepro_cmd, amanpandey_cmd as amanpandey_cmd

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "No name set yet nibba"
""" =======================CONSTANTS====================== """
EXTREMEPRO_PIC = os.environ.get("EXTREMEPRO_PIC", None) or "https://telegra.ph/file/75520b56df7b9159438cb.jpg"
EXTREMEPRO = f"**`Owner`: {DEFAULTUSER}`**\n\n"
EXTREMEPRO = f" ┏━━━━━━━━━━━━━━━━━━━\n"
EXTREMEPRO += f"┣•➳➠ `σωηєя :` `{DEFAULTUSER}` \n"
EXTREMEPRO += f"┣•➳➠ `𝓣𝓮𝓵𝓮𝓽𝓱𝓸𝓷 𝓥𝓮𝓻𝓼𝓲𝓸𝓷 :` `1.21.1` \n"
EXTREMEPRO += f"┣•➳➠ `𝐸𝓍𝓉𝓇𝑒𝓂𝑒𝒫𝓇𝑜 𝒱𝑒𝓇𝓈𝒾𝑜𝓃 :` `0.0.1`\n"
EXTREMEPRO += f"┣•➳➠ `𝓟𝔂𝓽𝓱𝓸𝓷 𝓥𝓮𝓻𝓼𝓲𝓸𝓷 :` `3.9.5`\n"
EXTREMEPRO += f"┣•➳➠ `𝔖𝔲𝔭𝔭𝔬𝔯𝔱 :` [𝔖𝔲𝔭𝔭𝔬𝔯𝔱](https://t.me/ExtremeProuserbotsupport)\n"
EXTREMEPRO += f"┣•➳➠ `υρтιмє :` `{StartTime}` \n"
EXTREMEPRO += f"┣•➳➠ `яєρσ🔥 :` [яєρσ🔥](https://github.com/TeamExtremePro/ExtremeProUserbot)\n"
EXTREMEPRO += f"┣•➳➠ `ɖɛքʟօʏ⚡ :` [ɖɛքʟօʏ⚡Me](https://dashboard.heroku.com/new?button-url=https://dashboard.heroku.com/new?button-url=https%3A%2F%2Fgithub.com%2FTeamExtremePro%2FDeploy&template=https%3A%2F%2Fgithub.com%2FTeamExtremePro%2FDeploy)\n"
EXTREMEPRO += f"┗━━━━━━━━━━━━━━━━━━━\n"
@borg.on(extremepro_cmd(outgoing=True, pattern="alive$"))
@borg.on(amanpandey_cmd(pattern="alive$", allow_sudo=True))
async def up(op):
    if op.fwd_from:
        return
    await op.get_chat()
    await op.delete()
    await borg.send_file(op.chat_id, EXTREMEPRO_PIC, caption=EXTREMEPRO)
    await op.delete() 
Пример #4
0
.padmin"""

from telethon import events

import asyncio
from Extre import CMD_HELP
from Extre.utils import extremepro_cmd

from Extre import ALIVE_NAME
from Extre.utils import extremepro_cmd

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Extre USER"


@borg.on(extremepro_cmd(pattern=f"padmin", outgoing=True))
async def _(event):

    if event.fwd_from:

        return

    animation_interval = 1

    animation_ttl = range(0, 20)

    await event.edit("promoting.......")

    animation_chars = [
        "**Promoting User As Admin...**",
        "**Enabling All Permissions To User...**", "**(1) Send Messages: ☑️**",
Пример #5
0
    send_media=None,
    send_stickers=None,
    send_gifs=None,
    send_games=None,
    send_inline=None,
    embed_links=None,
)

MUTE_RIGHTS = ChatBannedRights(until_date=None, send_messages=True)

UNMUTE_RIGHTS = ChatBannedRights(until_date=None, send_messages=False)
# ================================================


#@register(outgoing=True, pattern="^.setgpic$")
@borg.on(extremepro_cmd(pattern=r"setgpic"))
@errors_handler
async def set_group_photo(gpic):
    """ For .setgpic command, changes the picture of a group """
    if not gpic.is_group:
        await gpic.edit("`I don't think this is a group.`")
        return
    replymsg = await gpic.get_reply_message()
    chat = await gpic.get_chat()
    admin = chat.admin_rights
    creator = chat.creator
    photo = None

    if not admin and not creator:
        await gpic.edit(NO_ADMIN)
        return
Пример #6
0
            return
        if sender.user.bot:
            return
        if sender.user.verified:
            return
        if PM_ON_OFF == "DISABLE":
            return
        if not pmpermit_sql.is_approved(event.chat_id):
            if not event.chat_id in PM_WARNS:
                pmpermit_sql.approve(event.chat_id, "outgoing")
                bruh = "AutoApproved [{}](tg://user?id={}) Due To Out Going Message !".format(first_name, event.chat_id)
                rko = await borg.send_message(event.chat_id, bruh)
                await asyncio.sleep(3)
                await rko.delete()           

    @borg.on(extremepro_cmd(pattern="(a|approve)$"))
    async def approve(event):
        if event.fwd_from:
            return
        if event.is_private:
            replied_user = await event.client(GetFullUserRequest(await event.get_input_chat()))
            firstname = replied_user.user.first_name
            if not pmpermit_sql.is_approved(event.chat_id):
                if event.chat_id in PM_WARNS:
                    del PM_WARNS[event.chat_id]
                if event.chat_id in PREV_REPLY_MESSAGE:
                    await PREV_REPLY_MESSAGE[event.chat_id].delete()
                    del PREV_REPLY_MESSAGE[event.chat_id]
                pmpermit_sql.approve(event.chat_id, "Approved Another Nibba")
                await event.edit(
                    "Approved to pm [{}](tg://user?id={})".format(firstname, event.chat_id)
Пример #7
0
# Added more fonts by @legendx22
# Ported from saitama i guess

from telethon import events
from Extre.utils import extremepro_cmd, edit_or_reply

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']
weebyfont = ['卂','乃','匚','刀','乇','下','厶','卄','工','丁','长','乚','从','𠘨','口','尸','㔿','尺','丂','丅','凵','リ','山','乂','丫','乙']
tantextfont = ['Ꭿ','Ᏸ','Ꮳ','Ꮄ','Ꮛ','Ꮄ','Ꮆ','Ꮒ','i','Ꮰ','Ꮶ','l','m','Ꮑ','Ꮻ','Ꮅ','Ꮔ','ᖇ','Ꭶ','Ꮏ','Ꮜ','Ꮙ','Ꮿ','メ','Ꭹ','Ꮓ']
linetextfont = ['𝔸','𝔹','ℂ','𝔻','𝔼','𝔽','𝔾','ℍ','𝕀','𝕁','𝕂','𝕃','𝕄','ℕ','𝕆','ℙ','ℚ','ℝ','𝕊','𝕋','𝕌','𝕍','𝕎','𝕏','𝕐','ℤ']
boxtextfont = ['🄰','🄱','🄲','🄳','🄴','🄵','🄶','🄷','🄸','🄹','🄺','🄻','🄼','🄽','🄾','🄿','🅀','🅁','🅂','🅃','🅄','🅅','🅆','🅇','🅈','🅉']
bubbletextfont = ['Ⓐ','Ⓑ','Ⓒ','Ⓓ','Ⓔ','Ⓕ','Ⓖ','Ⓗ','Ⓘ','Ⓙ','Ⓚ','Ⓛ','Ⓜ','Ⓝ','Ⓞ','Ⓟ','Ⓠ','Ⓡ','Ⓢ','Ⓣ','Ⓤ','Ⓥ','Ⓦ','Ⓧ','Ⓨ','Ⓩ']


@borg.on(extremepro_cmd(pattern="weeb ?(.*)"))
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("`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)]
            string = string.replace(normiecharacter, weebycharacter)
    await event.edit(string)
    
Пример #8
0
"""File Converter
.convert mp3 """

import asyncio
import os
import time
from datetime import datetime
from Extre.utils import extremepro_cmd, progress


@borg.on(extremepro_cmd(pattern="convert (.*)"))  # pylint:disable=E0602
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    reply_message = await event.get_reply_message()
    if reply_message is None:
        await event.edit(
            "reply to a media to use the `nfc` operation.\nInspired by @FileConverterBot"
        )
        return
    await event.edit("trying to download media file, to my local")
    try:
        start = datetime.now()
        c_time = time.time()
        downloaded_file_name = await borg.download_media(
            reply_message,
            Config.TMP_DOWNLOAD_DIRECTORY,
            progress_callback=lambda d, t: asyncio.get_event_loop(
            ).create_task(progress(d, t, event, c_time, "trying to download")))
    except Exception as e:  # pylint:disable=C0103,W0703
Пример #9
0
"""Create Private Groups
Available Commands:
.create (b|g) GroupName"""
from telethon.tl import functions
from Extre import CMD_HELP
from Extre.utils import extremepro_cmd, edit_or_reply, amanpandey_cmd


@bot.on(extremepro_cmd(pattern="create (b|g|c) (.*)"))  # pylint:disable=E0602
@bot.on(amanpandey_cmd(pattern="create (b|g|c) (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    type_of_group = event.pattern_match.group(1)
    group_name = event.pattern_match.group(2)
    event = await edit_or_reply(event, "Creating wait sar.....")
    if type_of_group == "b":
        try:
            result = await event.client(
                functions.messages.CreateChatRequest(  # pylint:disable=E0602
                    users=["@sarah_robot"],
                    # Not enough users (to create a chat, for example)
                    # Telegram, no longer allows creating a chat with ourselves
                    title=group_name,
                ))
            created_chat_id = result.chats[0].id
            await event.client(
                functions.messages.DeleteChatUserRequest(
                    chat_id=created_chat_id, user_id="@sarah_robot"))
            result = await event.client(
                functions.messages.ExportChatInviteRequest(
Пример #10
0
from telethon.tl.functions.users import GetFullUserRequest

from telethon.tl.types import MessageEntityMentionName

from telethon.utils import get_input_location

logger = logging.getLogger(__name__)

if 1 == 1:

    name = "Profile Photos"

    client = borg

    @borg.on(extremepro_cmd(pattern="poto(.*)"))
    async def potocmd(event):
        """Gets the profile photos of replied users, channels or chats"""

        id = "".join(event.raw_text.split(maxsplit=2)[1:])

        user = await event.get_reply_message()

        chat = event.input_chat

        if user:

            photos = await event.client.get_profile_photos(user.sender)

        else:
Пример #11
0
from selenium.webdriver.chrome.options import Options
from Extre.utils import extremepro_cmd, edit_or_reply, amanpandey_cmd
from Extre import ALIVE_NAME, CMD_HELP

# Google Drive ()
CHROME_BIN = os.environ.get("CHROME_BIN", "/app/.apt/usr/bin/google-chrome")
CHROME_DRIVER = os.environ.get("CHROME_DRIVER",
                               "/app/.chromedriver/bin/chromedriver")

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Extre USER"

CARBONLANG = "auto"
LANG = "en"


@borg.on(extremepro_cmd(outgoing=True, pattern="carbon(?: |$)(.*)"))
@borg.on(amanpandey_cmd(pattern="carbon(?: |$)(.*)", allow_sudo=True))
async def carbon_api(e):
    """ A Wrapper for carbon.now.sh """
    await e.edit("`Processing..`")
    CARBON = "https://carbon.now.sh/?l={lang}&code={code}"
    textx = await e.get_reply_message()
    pcode = e.text
    if pcode[8:]:
        pcode = str(pcode[8:])
    elif textx:
        pcode = str(textx.message)  # Importing message to module
    pcode = deEmojify(pcode)
    code = quote_plus(pcode)  # Converting to urlencoded
    godboy = await edit_or_reply(e, "`Carbonizing...\n25%`")
    url = CARBON.format(code=code, lang=CARBONLANG)
Пример #12
0
import datetime
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from Extre.utils import extremepro_cmd
from Extre import bot, CMD_HELP

@borg.on(extremepro_cmd(pattern="sg ?(.*)"))
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 = "Sangmatainfo_bot"
    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:     
              #await conv.send_message("/search_id {}".format(sender))
              response1 = conv.wait_event(events.NewMessage(incoming=True,from_users=461843263))
              response2 = conv.wait_event(events.NewMessage(incoming=True,from_users=461843263))
              response3 = conv.wait_event(events.NewMessage(incoming=True,from_users=461843263))
              await conv.send_message("/search_id {}".format(sender))
              response1 = await response1 
              response2 = await response2 
              response3= await response3