Esempio n. 1
0
                                                reply_message.from_id,
                                                until_date=None,
                                                view_messages=False)
            reply = "{} warnings, <u><a href='tg://user?id={}'>user</a></u> has been banned!".format(
                limit, reply_message.from_id)
    else:
        reply = "<u><a href='tg://user?id={}'>user</a></u> has {}/{} warnings... watch out!".format(
            reply_message.from_id, num_warns, limit)
        if warn_reason:
            reply += "\nReason for last warn:\n{}".format(
                html.escape(warn_reason))
    #
    await event.edit(reply, parse_mode="html")


@wolfs.on(itzjass(pattern=f"warn(?: |$)(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    try:
        chat = await event.get_chat()
        admin = chat.admin_rights
        creator = chat.creator
        warn_reason = event.pattern_match.group(1)
        reply_message = await event.get_reply_message()
    except:
        return await event.reply("`Sorry canot warn users here`")
    if not admin and not creator:
        return await event.reply("`I have to be admin to warn people.`")
    if await is_admin(event.chat_id, reply_message.from_id):
        return await event.reply("`I'm not going to warn an admin!`")
Esempio n. 2
0

@mrsammy(outgoing=True, pattern="^!saveblacklist ((.|\n)*)")
async def on_add_black_list(event):
    text = event.pattern_match.group(1)
    to_blacklist = list(
        set(trigger.strip() for trigger in text.split("\n")
            if trigger.strip()))
    for trigger in to_blacklist:
        sql.add_to_blacklist(event.chat_id, trigger.lower())
    await event.edit(
        "Added {} triggers to the blacklist in the current chat".format(
            len(to_blacklist)))


@wolfs.on(itzjass(pattern=f"saveblacklist ((.|\n)*)", allow_sudo=True))
async def on_add_black_list(event):
    text = event.pattern_match.group(1)
    to_blacklist = list(
        set(trigger.strip() for trigger in text.split("\n")
            if trigger.strip()))
    for trigger in to_blacklist:
        sql.add_to_blacklist(event.chat_id, trigger.lower())
    await event.reply(
        "Added {} triggers to the blacklist in the current chat".format(
            len(to_blacklist)))


@mrsammy(outgoing=True, pattern="^!checkblacklist(?: |$)(.*)")
async def on_view_blacklist(listbl):
    all_blacklisted = sql.get_chat_blacklist(listbl.chat_id)
Esempio n. 3
0
    except:
          return await event.edit("Failed to connect virus total , is api key added? type `!help virus_scan` for more info")
    try:
      vr = vtotal.file_scan(vscan)
    except:
      return await event.edit("`Unknown command type !help virus_scan for more info")            
    test = vr['json_resp'] ; link = test['permalink'] ; scan_id = test['scan_id'] ; response_code = test['response_code']
    return await event.edit(""                 
                    f"• **Virus Total Response Code:** `{response_code}`\n"                                 
                    f"• **Scan Results:** [ClickHere]({link}) ")
                    
                    
                    
                    

@wolfs.on(itzjass(pattern=f"scan(?: |$)(.*)", allow_sudo=True))
async def vt(event):
    rkp = await event.reply(f"Analyzing Datas......")
    input_str = event.pattern_match.group(1)
    if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY):
        os.makedirs(TEMP_DOWNLOAD_DIRECTORY)
    if "|" in input_str:
        url, file_name = input_str.split("|")
        url = url.strip()      
        file_name = file_name.strip()
        head, tail = os.path.split(file_name)
        if head:
            if not os.path.isdir(os.path.join(TEMP_DOWNLOAD_DIRECTORY, head)):
                os.makedirs(os.path.join(TEMP_DOWNLOAD_DIRECTORY, head))
                file_name = os.path.join(head, tail)
        downloaded_file_name = TEMP_DOWNLOAD_DIRECTORY + "" + file_name
Esempio n. 4
0

def inline_mention(user):
    full_name = user_full_name(user) or "No Name"
    return f"[{full_name}](tg://user?id={user.id})"


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


@mrsammy(outgoing=True, pattern="^!reupload (.*)")
@wolfs.on(itzjass(pattern=f"reupload (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    thumb = None
    if os.path.exists(thumb_image_path):
        thumb = thumb_image_path
    sender = await event.get_sender()
    me = await event.client.get_me()
    if not sender.id == me.id:
        rkp = await event.reply("`processing...`")
    else:
        rkp = await event.edit("`processing...`")
    input_str = event.pattern_match.group(1)
    if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY):
        os.makedirs(TEMP_DOWNLOAD_DIRECTORY)
Esempio n. 5
0
import asyncio, os
from asyncio import wait, sleep
from wolf import BOTLOG, BOTLOG_CHATID, CMD_HELP
from wolf.events import mrsammy, itzjass
from wolf import client as wolfs
FULL_SUDO = os.environ.get("FULL_SUDO", None)


@wolfs.on(itzjass(pattern=f"(?:scam|ssc)\s(.*)", allow_sudo=True))
@mrsammy(outgoing=True, pattern=r"^\!(?:scam|ssc)\s(.*)")
async def scam(e):
    if not e.is_private:
        chat = await e.get_chat()
        admin = chat.admin_rights
        creator = chat.creator
        if not admin and not creator and chat.id == -1001288555028:
            return
    try:
        await e.delete()
    except:
        pass
    options = ('typing', 'game', 'voice', 'round', 'video', 'photo',
               'document')
    input_str = e.pattern_match.group(1)
    args = input_str.split()
    if len(args) == 2:
        scam_action = str(args[1]).lower()
        if not scam_action in options:
            return await e.reply(
                f"Failed \n\n •**Error:** Invalid Action\n\n You can use one of this \n{options}"
            )
Esempio n. 6
0
    os.remove(downloaded_file_name)
    if not t_response:
        logger.info(e_response)
        logger.info(t_response)
        await qr_e.edit("Failed to decode.")
        return
        LOGS.info(e_response)
        LOGS.info(t_response)
        return await qr_e.edit("Failed to decode.")
    soup = BeautifulSoup(t_response, "html.parser")
    qr_contents = soup.find_all("pre")[0].text
    await qr_e.edit(qr_contents)



@wolfs.on(itzjass(pattern=f"decodeqr$", allow_sudo=True))
async def parseqr(qr_e): 
    downloaded_file_name = await qr_e.client.download_media(
        await qr_e.get_reply_message())
    # parse the Official ZXing webpage to decode the QRCode
    command_to_exec = [
        "curl", "-X", "POST", "-F", "f=@" + downloaded_file_name + "",
        "https://zxing.org/w/decode"
    ]
    process = await asyncio.create_subprocess_exec(
        *command_to_exec,
        # stdout must a pipe to be accessible as process.stdout
        stdout=asyncio.subprocess.PIPE,
        stderr=asyncio.subprocess.PIPE,
    )
    # Wait for the subprocess to finish
Esempio n. 7
0
                    f"**{ALIVE_E_MMSG}**")
    await alive.client.send_file(alive.chat_id, shivam,caption=text, force_document=False)
    await alive.delete()

@mrsammy(outgoing=True, pattern="^\.alive$")
@mrsammy(outgoing=True, pattern="^\!alive$")
async def alive(alive):
    text=("Iam On type` !wolfs `or` !help `for more info....")
    await alive.client.send_file(alive.chat_id, shivam,caption=text, force_document=False)
    await alive.delete()





@bot.on(itzjass(pattern=f"sudo$", allow_sudo=True))
@bot.on(itzjass(pattern=f"wolfs$", allow_sudo=True))
async def alive(alive):
    text=(""
                    f"**{ALIVE_S_MMSG}**\n\n"                     
                    f" °  `{WOLF_NNAME}`: **{v}**\n"
                    f" °  `Sudo Id:` ** {rksu} **\n"
                    f" °  `Telethon`: ** {version.__version__} **\n"
                    f" °  `Python` : ** {platform.python_version()} **\n"                                                                                     
                    f" °  `Os:` ** Kali GNU/Linux Rolling x86_64   **\n"                                       
                    f" °  `Heroku:` ** {herokurk} **\n"
                    f" °  `LogChat:` ** {logrk} **\n"
                    f" °  `Sudo:` ** {sudork} **\n"
                    f" °  `SpamProtect:` ** {ss} **\n"                    
                    f" °  `Uptime:` ** {str(datetime.now() - START_TIME).split('.')[0]} **\n\n"                                   
                    f"**{ALIVE_E_MMSG}**")
Esempio n. 8
0
    "\U0001F680-\U0001F6FF"  # transport & map symbols
    "\U0001F700-\U0001F77F"  # alchemical symbols
    "\U0001F780-\U0001F7FF"  # Geometric Shapes Extended
    "\U0001F800-\U0001F8FF"  # Supplemental Arrows-C
    "\U0001F900-\U0001F9FF"  # Supplemental Symbols and Pictographs
    "\U0001FA00-\U0001FA6F"  # Chess Symbols
    "\U0001FA70-\U0001FAFF"  # Symbols and Pictographs Extended-A
    "\U00002702-\U000027B0"  # Dingbats
    "]+")


def deEmojify(inputString: str) -> str:
    return re.sub(EMOJI_PATTERN, '', inputString)


@wolfs.on(itzjass(pattern=f"song2(?: |$)(.*)", allow_sudo=True))
@mrsammy(outgoing=True, pattern="^!song2(?: |$)(.*)")
async def _(event):
    sender = await event.get_sender()
    me = await event.client.get_me()
    if not sender.id == me.id:
        rkp = await event.reply("`processing...`")
    else:
        rkp = await event.edit("`processing...`")
    try:
        reply_message = event.pattern_match.group(1)
        if not reply_message:
            reply_message = await event.get_reply_message()
            if reply_message:
                if reply_message.media:
                    return await rkp.edit("`Reply to a text message`")
Esempio n. 9
0
                    if USERS[sender.sender_id] % randint(2, 4) == 0:
                        if AFKREASON:
                            await sender.reply(
                                f"`{WOLF_NNAME}: ` **In case you didn't notice,  My master Still Offline**\
                        \n\n`Reason:` **{AFKREASON}**\n`Since :`**{afk_since}**"
                            )
                        else:
                            await sender.reply(str(choice(AFKSTR)))
                        USERS[sender.sender_id] = USERS[sender.sender_id] + 1
                        COUNT_MSG = COUNT_MSG + 1
                    else:
                        USERS[sender.sender_id] = USERS[sender.sender_id] + 1
                        COUNT_MSG = COUNT_MSG + 1


@wolfs.on(itzjass(pattern=f"userinfo(?: |$)(.*)", allow_sudo=True))
@mrsammy(outgoing=True, pattern="^\!userinfo(?: |$)(.*)")
async def _(event):
    sender = await event.get_sender()
    me = await event.client.get_me()
    if not sender.id == me.id:
        rkp = await event.reply("`processing`")
    else:
        rkp = await event.edit("`processing`")
    if event.fwd_from:
        return
    ruser, rdhs = await get_full_user(event)
    if ruser is None:
        await rkp.edit("Error please mention user")
        return False
    ruser_profile_photos = await event.client(
Esempio n. 10
0
        if os.path.isdir(current_file_name):
            return get_lst_of_files(current_file_name, output_lst)
        output_lst.append(current_file_name)
    return output_lst

def zipdir(path, ziph):
    # ziph is zipfile handle
    for root, dirs, files in os.walk(path):
        for file in files:
            ziph.write(os.path.join(root, file))
            os.remove(os.path.join(root, file))




@wolfs.on(itzjass(pattern=f"telegraph (media|text)$", allow_sudo=True))
@mrsammy(outgoing=True, pattern="^!telegraph (media|text)$")
async def telegraphs(graph):    
  try:
    sender = await graph.get_sender() ; me = await graph.client.get_me()
    if not sender.id == me.id:
        rkp = await graph.reply("`processing`")
    else:
    	rkp = await graph.edit("`processing`")
    if graph.text[0].isalpha() or graph.text[0] in ("/", "#", "@") or graph.fwd_from:
        return 
    if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY):
        os.makedirs(TEMP_DOWNLOAD_DIRECTORY)
    if graph.reply_to_msg_id:
        start = datetime.now()
        r_message = await graph.get_reply_message()
Esempio n. 11
0
    if stdout or stderr:
        if not len(text) > 4096:
            return await event.edit(text)
    output = open("term.txt", "w+")
    output.write(text)
    output.close()
    await event.client.send_file(
        event.chat_id,
        "term.txt",
        reply_to=event.id,
        caption=f"`{WOLF_NNAME}:` **Output too large, sending as file**")
    os.remove("term.txt")
    return


@wolfs.on(itzjass(pattern=f"term(?: |$|\n)([\s\S]*)", allow_sudo=True))
async def evaluate(event):
    if not FULL_SUDO:
        await query.reply(
            f"`{WOLF_NNAME}:` **Sorry , Normal Sudo cant acess this comand,  active advance sudo by set  FULL_SUDO as true in heroku var**"
        )
    else:
        rkp = await event.reply(f"**{WOLF_NNAME}**: `Running Terminal.....`")
        message = (str(event.chat_id) + ':' + str(event.message.id))
        if running_processes.get(message, False):
            await rkp.edit("A process for this event is already running!")
            return
        cmd = event.pattern_match.group(1).strip()
        if not cmd:
            await rkp.edit("``` Give a command or use .help script.```")
            return
Esempio n. 12
0
    for search_result in search_response.get("items", []):
        if search_result["id"]["kind"] == "youtube#video":
            videos.append(search_result)
    try:
        nexttok = search_response["nextPageToken"]
        return (nexttok, videos)
    except HttpError:
        nexttok = "last_page"
        return (nexttok, videos)
    except KeyError:
        nexttok = "KeyError, try again."
        return (nexttok, videos)


@wolfs.on(itzjass(pattern=f"read(?: |$)(.*)", allow_sudo=True))
async def ocr(event):
    if OCR_SPACE_API_KEY is None:
        await event.reply(
            f"`{WOLF_NNAME}:` **ocr api key missing please add it before use**"
        )
    else:
        await event.reply(f"`{WOLF_NNAME}:` **Reading...**")
        if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY):
            os.makedirs(TEMP_DOWNLOAD_DIRECTORY)
        lang_code = event.pattern_match.group(1)
        downloaded_file_name = await bot.download_media(
            await event.get_reply_message(), TEMP_DOWNLOAD_DIRECTORY)
        test_file = await ocr_space_file(filename=downloaded_file_name,
                                         language=lang_code)
        try:
Esempio n. 13
0
            else:
                await event.edit(
                    "`Unknown module type !help to see all modules`")
        else:
            await event.edit(" For Support, Report bugs & help @wolfs2suPPort "
                             )
            string = (
                f"`Use !help <module_name>`\n\n**Currently Loaded [{len(CMD_HELP)}] Modules **\n"
            )
            for i in CMD_HELP:
                string += "`" + str(i)
                string += "`\n"
            await event.reply(string)


@wolfs.on(itzjass(pattern=f"help(?: |$)(.*)", allow_sudo=True))
async def help(event):
    args = event.pattern_match.group(1).lower()
    if args:
        if args in CMD_HELP:
            await event.reply(str(CMD_HELP[args]))
        else:
            await event.reply("`Unknown module type !help to see all modules`")
    else:
        await event.reply(" For Support, Report bugs & help @wolfs2SuPPort ")
        string = (
            f"`Use .help <module_name>`\n\n**Currently Loaded [{len(CMD_HELP)}] Modules **\n"
        )
        for i in CMD_HELP:
            string += "`" + str(i)
            string += "`\n"
Esempio n. 14
0
                admin = chat.admin_rights
                creator = chat.creator
                if admin or creator:
                    try:
                        await client.edit_permissions(rkG.chat_id,
                                                      guser.id,
                                                      view_messages=False)
                        await rkG.reply(
                            f"`{WOLF_NNAME}:` ** Gbanned User Joined!!** \n"
                            f"**Victim Id**: [{guser.id}](tg://user?id={guser.id})\n"
                            f"**Action **  : `Banned`")
                    except:
                        return


@wolfs.on(itzjass(pattern=f"gmute(?: |$)(.*)", allow_sudo=True))
@mrsammy(outgoing=True, pattern="^!gmute(?: |$)(.*)")
async def gspider(rk):
    lazy = rk
    sender = await lazy.get_sender()
    me = await lazy.client.get_me()
    if not sender.id == me.id:
        rkp = await lazy.reply("`processing...`")
    else:
        rkp = await lazy.edit("`processing...`")
    me = await rk.client.get_me()
    await rkp.edit(f"`Gmuting....`")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    my_username = f"@{me.username}" if me.username else my_mention
    chat = await rk.get_chat()
    a = b = 0
Esempio n. 15
0
        chrome_options = await options()
    if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY):
        os.mkdir(TEMP_DOWNLOAD_DIRECTORY)
    prefs = {'download.default_directory': TEMP_DOWNLOAD_DIRECTORY}
    chrome_options.add_experimental_option('prefs', prefs)
    driver = webdriver.Chrome(executable_path=CHROME_DRIVER,
                              options=chrome_options)
    return driver


GITHUB = 'https://github.com'
DEVICES_DATA = 'https://raw.githubusercontent.com/androidtrackers/' \
               'certified-android-devices/master/devices.json'


@wolfs.on(itzjass(pattern=f"app (.*)", allow_sudo=True))
@mrsammy(outgoing=True, pattern="^!app (.*)")
async def apk(e):
    sender = await e.get_sender()
    me = await e.client.get_me()
    if not sender.id == me.id:
        rkp = await e.reply("`processing...`")
    else:
        rkp = await e.edit("`processing...`")
    try:
        app_name = e.pattern_match.group(1)
        remove_space = app_name.split(' ')
        final_name = '+'.join(remove_space)
        page = requests.get("https://play.google.com/store/search?q=" +
                            final_name + "&c=apps")
        lnk = str(page.status_code)
Esempio n. 16
0
    await event.edit(OUTPUT)




 








@wolfs.on(itzjass(pattern=f"kang", allow_sudo=True))
async def kang(args):
    """ For .kang command, kangs stickers or creates new ones. """
    kang_meme = random.choice(KANGING_STR)
    user = await bot.get_me()
    if not user.username:
        user.username = user.first_name
    message = await args.get_reply_message()
    photo = None
    emojibypass = False
    is_anim = False
    emoji = None

    if message and message.media:
        if isinstance(message.media, MessageMediaPhoto):
            #await args.reply(f"`{kang_meme}`")