Beispiel #1
0
"""Emoji

Available Commands:

.think"""


import asyncio

from WhiteEyeUserBot.utils import WhiteEye_on_cmd
from WhiteEyeUserBot import CMD_HELP


@WhiteEye.on(WhiteEye_on_cmd("think"))
async def _(event):
    if event.fwd_from:
        return
    animation_interval = 0.1
    animation_ttl = range(0, 288)

    # await event.edit(input_str)
    await event.edit("thinking")
    animation_chars = [
        "THINKING",
        "THI&K#N₹",
        "T+IN@I?G",
        "¿H$NK∆NG",
        "¶H×NK&N*",
        "NGITHKIN",
        "T+I#K@₹G",
        "THINKING",
Beispiel #2
0
def time_formatter(milliseconds: int) -> str:
    """Inputs time in milliseconds, to get beautified time,
    as string"""
    seconds, milliseconds = divmod(int(milliseconds), 1000)
    minutes, seconds = divmod(seconds, 60)
    hours, minutes = divmod(minutes, 60)
    days, hours = divmod(hours, 24)
    tmp = (((str(days) + " day(s), ") if days else "") +
           ((str(hours) + " hour(s), ") if hours else "") +
           ((str(minutes) + " minute(s), ") if minutes else "") +
           ((str(seconds) + " second(s), ") if seconds else "") +
           ((str(milliseconds) + " millisecond(s), ") if milliseconds else ""))
    return tmp[:-2]


@WhiteEye.on(WhiteEye_on_cmd(pattern="yt(a|v) (.*)"))
@WhiteEye.on(sudo_cmd(pattern="yt(a|v) (.*)", allow_sudo=True))
async def download_video(v_url):
    """ For .ytdl command, download media from YouTube and many other sites. """
    url = v_url.pattern_match.group(2)
    type = v_url.pattern_match.group(1).lower()
    friday = await edit_or_reply(v_url, "Trying To Download......")
    await friday.edit("`Preparing to download...`")

    if type == "a":
        opts = {
            "format":
            "bestaudio",
            "addmetadata":
            True,
            "key":
Beispiel #3
0
"""DA.GD helpers in @UniBorg
Available Commands:
.isup URL
.dns google.com
.url <long url>
.unshort <short url>"""
import requests

from WhiteEyeUserBot.utils import edit_or_reply, WhiteEye_on_cmd, sudo_cmd


@WhiteEye.on(WhiteEye_on_cmd("dns (.*)"))
@WhiteEye.on(sudo_cmd("dns (.*)", allow_sudo=True))
async def _(event):
    starky = await edit_or_reply(event, "Processing.....")
    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 starky.edit("DNS records of {} are \n{}".format(input_str, response_api))
    else:
        await starky.edit("i can't seem to find {} on the internet".format(input_str))


@WhiteEye.on(WhiteEye_on_cmd("url (.*)"))
@WhiteEye.on(sudo_cmd("dns (.*)", allow_sudo=True))
async def _(event):
    starkxd = await edit_or_reply(event, "Processing....")
    if event.fwd_from:
Beispiel #4
0
# Modded from dagd.py
"""
Animate How To Google
Command .ggl Search Query
By @loxxi
"""

import requests

from WhiteEyeUserBot.utils import WhiteEye_on_cmd
from WhiteEyeUserBot import CMD_HELP


@WhiteEye.on(WhiteEye_on_cmd("ggl (.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    sample_url = "https://da.gd/s?url=https://lmgtfy.com/?q={}%26iie=1".format(
        input_str.replace(" ", "+"))
    response_api = requests.get(sample_url).text
    if response_api:
        await event.edit("[{}]({})\n`Thank me Later 🙃` ".format(
            input_str, response_api.rstrip()))
    else:
        await event.edit("something is wrong. please try again later.")


CMD_HELP.update({
    "howtogoogle":
    "**How To Google**\
Beispiel #5
0
"""Enable Seen Counter in any message,Credits To Xtra-Tg Owner 
to know how many users have seen your message
Syntax: .fwd as reply to any message"""
from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="frwd"))
async def _(event):
    if event.fwd_from:
        return
    if Config.PRIVATE_GROUP_ID is None:
        await event.edit(
            "Please set the required environment variable `PRIVATE_GROUP_ID` for this plugin to work"
        )
        return
    try:
        e = await borg.get_entity(Config.PRIVATE_GROUP_ID)
    except Exception as e:
        await event.edit(str(e))
    else:
        re_message = await event.get_reply_message()
        # https://t.me/telethonofftopic/78166
        fwd_message = await borg.forward_messages(e, re_message, silent=True)
        await borg.forward_messages(event.chat_id, fwd_message)
        await fwd_message.delete()
        await event.delete()
Beispiel #6
0
import io
import os
import time
from asyncio import create_subprocess_exec as asyncrunapp
from asyncio.subprocess import PIPE as asyncPIPE

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd

if not os.path.isdir("./SAVED"):
    os.makedirs("./SAVED")
if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY):
    os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY)


@WhiteEye.on(WhiteEye_on_cmd(outgoing=True, pattern="pips(?: |$)(.*)"))
async def pipcheck(pip):
    pipmodule = pip.pattern_match.group(1)
    if pipmodule:
        await pip.edit("`Searching . . .`")
        pipc = await asyncrunapp(
            "pip3",
            "search",
            pipmodule,
            stdout=asyncPIPE,
            stderr=asyncPIPE,
        )

        stdout, stderr = await pipc.communicate()
        pipout = str(stdout.decode().strip()) + str(stderr.decode().strip())
Beispiel #7
0
    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")


@WhiteEye.on(WhiteEye_on_cmd(pattern="avengersdp ?(.*)"))
async def main(event):

    await event.edit(
        "**Starting Avengers Profile Pic...\n\nDone !!! Check Your DP in 5 seconds. By [WhiteEye](https://github.com/MrDayamZaidi/WhiteEyeUserBot)**"
    )

    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")
               if ALIVE_NAME else "Set ALIVE_NAME in config vars in Heroku")
CUSTOM_MIDDLE_PMP = (str(CUSTOM_PMPERMIT)
                     if CUSTOM_PMPERMIT else "Protection By WhiteEye🇮🇳")
USER_BOT_WARN_ZERO = "You Have Attempted To Spam Masters Inbox So Inorder To Avoid Over Spam , You Have Been Blocked By WhiteEye"

botisnoob = Config.TG_BOT_USERNAME

USER_BOT_NO_WARN = (
    "**Hello, This is WhiteEye PM Protection Service ⚠️**\n\n"
    "**Caught You Here, Wanna Chat With My Master** 😏 \n\n"
    "**Then Wait And Choose A Reason Given Below For What Have You Come For.If You Tried To Spam Then I'll Make It Sure That You're Being Blocked.** \n\n"
)

if Config.PRIVATE_GROUP_ID is not None:

    @borg.on(WhiteEye_on_cmd(pattern="(a|approve)"))
    async def block(event):
        if event.fwd_from:
            return
        replied_user = await borg(GetFullUserRequest(event.chat_id))
        firstname = replied_user.user.first_name
        chats = await event.get_chat()
        if event.is_private:
            if not pmpermit_sql.is_approved(chats.id):
                if chats.id in PM_WARNS:
                    del PM_WARNS[chats.id]
                if chats.id in PREV_REPLY_MESSAGE:
                    await PREV_REPLY_MESSAGE[chats.id].delete()
                    del PREV_REPLY_MESSAGE[chats.id]
                pmpermit_sql.approve(chats.id, "Approved Another Nibba")
                await event.edit("Approved to pm [{}](tg://user?id={})".format(
Beispiel #9
0
""" Get the Bots in any chat*
Syntax: .get_bot"""
from telethon.tl.types import ChannelParticipantAdmin, ChannelParticipantsBots

from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd("get_bot ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    mentions = "**Bots in this Channel**: \n"
    input_str = event.pattern_match.group(1)
    to_write_chat = await event.get_input_chat()
    chat = None
    if not input_str:
        chat = to_write_chat
    else:
        mentions = "Bots in {} channel: \n".format(input_str)
        try:
            chat = await borg.get_entity(input_str)
        except Exception as e:
            await event.edit(str(e))
            return None
    try:
        async for x in borg.iter_participants(chat, filter=ChannelParticipantsBots):
            if isinstance(x.participant, ChannelParticipantAdmin):
                mentions += "\n ⚜️ [{}](tg://user?id={}) `{}`".format(
                    x.first_name, x.id, x.id
                )
            else:
Beispiel #10
0
from telethon.tl.types import InputMediaDice

from WhiteEyeUserBot.utils import WhiteEye_on_cmd
from WhiteEyeUserBot import CMD_HELP

# EMOJI CONSTANTS
DART_E_MOJI = "🎯"
DICE_E_MOJI = "🎲"
BALL_E_MOJI = "🏀"
# EMOJI CONSTANTS


@WhiteEye.on(
    WhiteEye_on_cmd(
        pattern=f"({DART_E_MOJI}|{DICE_E_MOJI}|{BALL_E_MOJI}) ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    reply_message = event
    if event.reply_to_msg_id:
        reply_message = await event.get_reply_message()
    emoticon = event.pattern_match.group(1)
    input_str = event.pattern_match.group(2)
    await event.delete()
    r = await reply_message.reply(file=InputMediaDice(emoticon=emoticon))
    if input_str:
        try:
            required_number = int(input_str)
            while not r.media.value == required_number:
                await r.delete()
                r = await reply_message.reply(file=InputMediaDice(
Beispiel #11
0
"""Get info about a File Extension
Syntax: .filext EXTENSION"""
import requests
from bs4 import BeautifulSoup

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="filext (.*)"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit("Processing ...")
    sample_url = "https://www.fileext.com/file-extension/{}.html"
    input_str = event.pattern_match.group(1).lower()
    response_api = requests.get(sample_url.format(input_str))
    status_code = response_api.status_code
    if status_code == 200:
        raw_html = response_api.content
        soup = BeautifulSoup(raw_html, "html.parser")
        ext_details = soup.find_all("td", {"colspan": "3"})[-1].text
        await event.edit(
            "**File Extension**: `{}`\n**Description**: `{}`".format(
                input_str, ext_details))
    else:
        await event.edit(
            "https://www.fileext.com/ responded with {} for query: {}".format(
                status_code, input_str))

Beispiel #12
0

def done_lago():
    logo = ("█████████    █████████ ██      █ █▒███████\n"
            "█        █   █       █ ▒ █     ▒ █\n"
            "█         █  █       █ █  ▒    █ █\n"
            "█   ▒▒     █ █  ▒▒▒  █ █   █   █ ███▒▒██\n"
            "█         █  █       █ █    ▒  █ █\n"
            "█        █   █       █ ▒     █ █ █\n"
            "█████████    █████████ █      ▒▒ ███▒████▒\n"
            "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒\n")
    print(f"{logo}")


# Main Commands
@WhiteEye.on(WhiteEye_on_cmd("web ?(.*)"))
async def WebData_By_Akash(webdata_credit_akash):
    link = webdata_credit_akash.pattern_match.group(1)
    await webdata_credit_akash.edit("**Deleting All** `.txt` **Files**")
    cmd("rm ./*.txt")  # Removing all Text Files
    await webdata_credit_akash.edit("**Deleting All** `.png` **Files**")
    cmd("rm ./*.png")  # Removing All Png Files
    await webdata_credit_akash.edit("**Deleting All** `.jpg` **Files**")
    cmd("rm ./*.jpg")  # Removing All jpg Files
    await webdata_credit_akash.edit("**Deleting All Files : Successful**")
    bot = webdriver.Chrome(executable_path=CHROME_DRIVER,
                           options=chrome_options)
    if link == "":
        bot.get(c(r))
        bot.get_screenshot_as_file(filename="NoWebsiteGiven.png")
        await webdata_credit_akash.client.send_file(
Beispiel #13
0
import asyncio

from WhiteEyeUserBot.utils import WhiteEye_on_cmd
from WhiteEyeUserBot import CMD_HELP


@WhiteEye.on(WhiteEye_on_cmd(pattern="phub"))
async def _(event):

    if event.fwd_from:

        return

    animation_interval = 0.5

    animation_ttl = range(0, 101)

    await event.edit("phub")

    animation_chars = [
        "P_",
        "PO_",
        "POR_",
        "PORN_",
        "PORNH_",
        "PORNHU_",
        "PORNHUB_",
        "PORNHUB",
    ]

    for i in animation_ttl:
Beispiel #14
0
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <https://www.gnu.org/licenses/>.

import cryptocompare

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="crypto (.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    stark = input_str.split(" ", 1)
    curreo = stark[0]
    currency1 = stark[1]
    curre = curreo.upper()
    currency = currency1.upper()
    take = ""
    take = cryptocompare.get_price(currency, curr=curre)
    t = take.get(currency)
    k = curre
    q = str(t.get(curre))
Beispiel #15
0
# Using this might lead to ban of your account, use at your own risk.
# Re-Written by @MrDayamZaidi

import asyncio
import time

from telethon.errors import FloodWaitError
from telethon.tl import functions

from WhiteEyeUserBot.utils import WhiteEye_on_cmd, sudo_cmd
from WhiteEyeUserBot import CMD_HELP

DEL_TIME_OUT = 60


@WhiteEye.on(WhiteEye_on_cmd(pattern="autobio"))  # pylint:disable=E0602
async def _(event):
    if event.fwd_from:
        return
    while True:
        DMY = time.strftime("%d.%m.%Y")
        HM = time.strftime("%H:%M:%S")
        bio = f"📅 {DMY} | This is my bio, I guess.. 😁 | ⌚️ {HM}"
        logger.info(bio)
        try:
            await borg(
                functions.account.UpdateProfileRequest(  # pylint:disable=E0602
                    about=bio))
        except FloodWaitError as ex:
            logger.warning(str(e))
            await asyncio.sleep(ex.seconds)
Beispiel #16
0
"""Take screenshot of any website
Syntax: .screenlong <Website URL>"""

import io
import traceback
from datetime import datetime

from selenium import webdriver

from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd("screenlong (.*)"))
async def _(event):
    if event.fwd_from:
        return
    if Config.GOOGLE_CHROME_BIN is None:
        await event.edit("need to install Google Chrome. Module Stopping.")
        return
    await event.edit("Processing ...")
    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")
        chrome_options.add_argument("--disable-dev-shm-usage")
        chrome_options.binary_location = Config.GOOGLE_CHROME_BIN
        await event.edit("Starting Google Chrome BIN")
Beispiel #17
0
from glitch_this import ImageGlitcher
from telethon.tl.types import MessageMediaPhoto

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd, sudo_cmd

glitcher = ImageGlitcher()
DURATION = 200  # Set this to however many centiseconds each frame should be visible for
LOOP = 0  # Set this to how many times the gif should loop
# LOOP = 0 means infinite loop
sedpath = "./starkgangz/"
if not os.path.isdir(sedpath):
    os.makedirs(sedpath)


@WhiteEye.on(WhiteEye_on_cmd(pattern=r"glitch"))
@WhiteEye.on(sudo_cmd(pattern=r"glitch", allow_sudo=True))
async def glitch(event):
    sed = await event.get_reply_message()
    okbruh = await event.edit("`Gli, Glitchiiingggg.....`")
    if event.fwd_from:
        return
    if isinstance(sed.media, MessageMediaPhoto):
        photolove = await borg.download_media(sed.media, sedpath)
    elif "image" in response.media.document.mime_type.split("/"):
        photolove = await borg.download_media(sed.media, sedpath)
    else:
        await event.edit("`Reply To Image`")
        return
    fmt = "gif"
    pathsn = f"./starkgangz/@WhiteEyeot.{fmt}"
Beispiel #18
0
#    GNU Affero General Public License for more details.

#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <https://www.gnu.org/licenses/>.

import asyncio

from telethon.errors.rpcerrorlist import YouBlockedUserError

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd, sudo_cmd

bot = "@MissRose_bot"


@WhiteEye.on(WhiteEye_on_cmd(pattern="fstat ?(.*)"))
@WhiteEye.on(sudo_cmd(pattern="fstat ?(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    ok = await event.edit("`Checking...`")
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        sysarg = str(previous_message.sender_id)
        user = f"[user](tg://user?id={sysarg})"
    else:
        sysarg = event.pattern_match.group(1)
        user = sysarg
    if sysarg == "":
        await ok.edit(
            "`Give me someones id, or reply to somones message to check his/her fedstat.`"
Beispiel #19
0
        time_list.append(int(result))
        seconds = int(remainder)

    for x in range(len(time_list)):
        time_list[x] = str(time_list[x]) + time_suffix_list[x]
    if len(time_list) == 4:
        ping_time += time_list.pop() + ", "

    time_list.reverse()
    ping_time += ":".join(time_list)

    return ping_time


# @command(pattern="^.latestupdate")
@WhiteEye.on(WhiteEye_on_cmd(pattern="latestupdate"))
async def _(event):
    if event.fwd_from:
        return
    start = datetime.now()
    await event.edit("Calculating Last Update or Restart Time")
    end = datetime.now()
    (end - start).microseconds / 1000
    uptime = get_readable_time((time.time() - Lastupdate))
    await event.edit(
        f"🔰 WhiteEye Userbot Has Been Restarted Or Updated {uptime} Ago !")


CMD_HELP.update({
    "lastupdate":
    "**LastUpdate**\
Beispiel #20
0
"""Take screenshot of any website
Syntax: .screencapture <Website URL>"""

import io

import requests

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd("screencapture (.*)"))
async def _(event):

    if event.fwd_from:

        return

    if Config.SCREEN_SHOT_LAYER_ACCESS_KEY is None:

        await event.edit(
            "Need to get an API key from https://screenshotlayer.com/product \nModule stopping!"
        )

        return

    await event.edit("Processing ...")

    sample_url = "https://api.screenshotlayer.com/api/capture?access_key={}&url={}&fullpage={}&viewport={}&format={}&force={}"

    input_str = event.pattern_match.group(1)
Beispiel #21
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 WhiteEyeUserBot.utils import WhiteEye_on_cmd
from WhiteEyeUserBot import CMD_HELP


@WhiteEye.on(WhiteEye_on_cmd(pattern="tagall"))
async def _(event):
    if event.fwd_from:
        return
    mentions = "@tagall"
    chat = await event.get_input_chat()
    async for x in borg.iter_participants(chat, 100):
        mentions += f"[\u2063](tg://user?id={x.id})"
    await event.reply(mentions)
    await event.delete()


CMD_HELP.update(
    {
        "tagall": "**Tagall**\
\n\n**Syntax : **`.tagall`\
\n**Usage :** tag everyone in a group"
    }
)
Beispiel #22
0
# @WhiteEyeoT

import requests
from iplookup import iplookup
from selenium import webdriver
from youtube_search import YoutubeSearch

from WhiteEyeUserBot.utils import edit_or_reply, WhiteEye_on_cmd, sudo_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="wshot ?(.*)"))
@WhiteEye.on(sudo_cmd(pattern="wshot ?(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    urlissed = event.pattern_match.group(1)
    sedlyfstarky = await edit_or_reply(event, "Capturing Webshot, Stay Tuned.")
    driver = webdriver.Chrome()
    driver.get(urlissed)
    driver.get_screenshot_as_file("*****@*****.**")
    imgpath = "*****@*****.**"
    await sedlyfstarky.edit("Completed. Uploading in Telegram..")
    await borg.send_file(
        event.chat_id,
        file=imgpath,
        caption=f"**WEBSHOT OF** `{urlissed}` \n**Powered By @WhiteEyeot**",
    )


@WhiteEye.on(WhiteEye_on_cmd(pattern="lp ?(.*)"))
@WhiteEye.on(sudo_cmd(pattern="lp ?(.*)", allow_sudo=True))
Beispiel #23
0
import re

import bs4
import requests

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="giz ?(.*)"))
async def gizoogle(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    await event.edit("Processing...")
    if not input_str:
        return await event.edit("I can't gizoogle nothing.")
    else:
        try:
            result = text(input_str)
        except:
            result = "Failed to gizoogle the text."
        finally:
            return await event.edit(result)


def text(input_text: str) -> str:
    """Taken from https://github.com/chafla/gizoogle-py/blob/master/gizoogle.py"""
    params = {"translatetext": input_text}
    target_url = "http://www.gizoogle.net/textilizer.php"
    resp = requests.post(target_url, data=params)
Beispiel #24
0
"""XKCD Search
Syntax: .xkcd <search>"""
from urllib.parse import quote

import requests
from WhiteEyeUserBot.utils import edit_or_reply, WhiteEye_on_cmd, sudo_cmd
from WhiteEyeUserBot import CMD_HELP


@WhiteEye.on(WhiteEye_on_cmd(pattern="xkcd ?(.*)"))
@WhiteEye.on(sudo_cmd(pattern="xkcd ?(.*)", allow_sudo=True))
async def _(event):
    livinglegend = await edit_or_reply(event, "Oh SeD Pls Wait")
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    xkcd_id = None
    if input_str:
        if input_str.isdigit():
            xkcd_id = input_str
        else:
            xkcd_search_url = "https://relevantxkcd.appspot.com/process?"
            queryresult = requests.get(xkcd_search_url,
                                       params={
                                           "action": "xkcd",
                                           "query": quote(input_str)
                                       }).text
            xkcd_id = queryresult.split(" ")[2].lstrip("\n")
    if xkcd_id is None:
        xkcd_url = "https://xkcd.com/info.0.json"
    else:
Beispiel #25
0
"""Emoji

Available Commands:

.wtf"""

import asyncio

from WhiteEyeUserBot.utils import WhiteEye_on_cmd
from WhiteEyeUserBot import CMD_HELP


@WhiteEye.on(WhiteEye_on_cmd("wtf"))
async def _(event):
    if event.fwd_from:
        return
    animation_interval = 0.3
    animation_ttl = range(0, 5)
    await event.edit("wtf")
    animation_chars = [
        "What",
        "What The",
        "What The F",
        "What The F Brah",
        "[What The F Brah](https://telegra.ph/file/63a02b3ef3245b321e54a.jpg)",
    ]

    for i in animation_ttl:

        await asyncio.sleep(animation_interval)
        await event.edit(animation_chars[i % 5])
Beispiel #26
0
"""COMMAND : .chu"""

import asyncio

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="hu"))
async def _(event):

    if event.fwd_from:

        return

    animation_interval = 1

    animation_ttl = range(0, 30)

    # input_str = event.pattern_match.group(1)

    # if input_str == "chu":

    await event.edit("Nice...")

    animation_chars = [
        "🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎",
        "◼️🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎",
        "◼️◼️🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎",
        "◼️◼️◼️️🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎",
        "◼️◼️◼️◼️🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎\n🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎🔴🔵🌕♓♎⛎",
Beispiel #27
0
"""Get Telegram Profile Picture and other information
and set as own profile.
Syntax: .clone @username"""

import asyncio
import html

from telethon.tl import functions
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageEntityMentionName

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="clone ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    reply_message = await event.get_reply_message()
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    user_id = replied_user.user.id
    profile_pic = await event.client.download_profile_photo(
        user_id, Config.TMP_DOWNLOAD_DIRECTORY)
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
Beispiel #28
0
import pyfiglet

from WhiteEyeUserBot import CMD_HELP
from WhiteEyeUserBot.utils import WhiteEye_on_cmd, edit_or_reply, sudo_cmd


@WhiteEye.on(WhiteEye_on_cmd(pattern="figlet ?(.*)", outgoing=True))
@WhiteEye.on(sudo_cmd(pattern="figlet ?(.*)", allow_sudo=True))
async def figlet(event):
    arjun = await edit_or_reply(event, "`Figleting This Text xD`")
    if event.fwd_from:
        return
    CMD_FIG = {
        "slant": "slant",
        "3D": "3-d",
        "5line": "5lineoblique",
        "alpha": "alphabet",
        "banner": "banner3-D",
        "doh": "doh",
        "iso": "isometric1",
        "letter": "letters",
        "allig": "alligator",
        "dotm": "dotmatrix",
        "bubble": "bubble",
        "bulb": "bulbhead",
        "digi": "digital",
    }
    input_str = event.pattern_match.group(1)
    if "|" in input_str:
        text, cmd = input_str.split("|", maxsplit=1)
    elif input_str is not None:
    "\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:
    """Remove emojis and other non-safe characters from string"""
    return re.sub(EMOJI_PATTERN, "", inputString)


# @register(outgoing=True, pattern="^.waifu(?: |$)(.*)", allow_sudo=True))
@WhiteEye.on(WhiteEye_on_cmd(pattern=r"waifu(?: |$)(.*)"))
@WhiteEye.on(sudo_cmd(pattern=r"waifu(?: |$)(.*)", allow_sudo=True))
async def waifu(animu):
    # """Creates random anime sticker!"""

    text = animu.pattern_match.group(1)
    if not text:
        if animu.is_reply:
            text = (await animu.get_reply_message()).message
        else:
            await edit_or_reply(
                animu,
                "`You haven't written any article, Waifu is going away.`")
            return
    animus = [1, 3, 7, 9, 13, 22, 34, 35, 36, 37, 43, 44, 45, 52, 53, 55]
    sticcers = await bot.inline_query(
Beispiel #30
0
"""
Created by @Jisan7509
plugin for @WhiteEyeOT
"""

from telethon.errors.rpcerrorlist import YouBlockedUserError

from WhiteEyeUserBot.utils import WhiteEye_on_cmd, edit_or_reply, sudo_cmd
from WhiteEyeUserBot import CMD_HELP


@WhiteEye.on(WhiteEye_on_cmd(pattern=r"score$"))
@WhiteEye.on(sudo_cmd(pattern=r"score$", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    chat = "@cricbuzz_bot"
    reply_to_id = event.message
    catevent = await edit_or_reply(event, "```Gathering info...```")
    async with event.client.conversation(chat) as conv:
        try:
            msg_start = await conv.send_message("/start")
            response = await conv.get_response()
            msg = await conv.send_message("/score")
            respond = await conv.get_response()
            await event.client.send_read_acknowledge(conv.chat_id)
        except YouBlockedUserError:
            await catevent.edit("Unblock @cricbuzz_bot & try again")
            return
        if respond.text.startswith("I can't find that"):
            await catevent.edit("sorry i can't find it")