Ejemplo n.º 1
0
""" Plugin By @chsaiujwal on telegram """
""" Plugin By @chsaiujwal on telegram """

from uniborg.util import mbl_cmd

from asyncio import wait

from telethon import events


@borg.on(mbl_cmd(pattern=r"hola"))
async def hi(event):
    if event.fwd_from:
        return
    await event.edit(
        "╔┓┏╦━╦┓╔┓╔━━╗\n║┗┛║┗╣┃║┃║X X  ║\n║┏┓║┏╣┗╣┗╣╰╯║\n╚┛┗╩━╩━╩━╩━━╝")


@borg.on(mbl_cmd(pattern=r"plus"))
async def hi(event):
    if event.fwd_from:
        return
    await event.edit(
        "╭━━━━━━━━━━━━━╮\n┃╱╱╱╱╱╱╱╱┏┓╱╱╱┃\n┃╱╱╱┏┓╱╱┏╯┃╱╱╱┃\n┃╱╱┏┛┗┓╱┗┓┃╱╱╱┃\n┃╱╱┗┓┏┛╱╱┃┃╱╱╱┃\n┃╱╱╱┗┛╱╱╱┃┃╱╱╱┃\n┃╱╱╱╱╱╱╱╱┗┛╱╱╱┃\n╰━━━━━━━━━━━━━╯"
    )


@borg.on(mbl_cmd(pattern=r"yes"))
async def hi(event):
    if event.fwd_from:
        return
Ejemplo n.º 2
0
"""XKCD Search
Syntax: .xkcd <search>"""
from telethon import events
import asyncio
import json
import requests
from urllib.parse import quote
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern="xkcd ?(.*)"))
async def _(event):
    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:
        xkcd_url = "https://xkcd.com/{}/info.0.json".format(xkcd_id)
Ejemplo n.º 3
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
""" Userbot module for frying stuff. ported by @NeoMatrix90 """

import io
from random import randint, uniform

from PIL import Image, ImageEnhance, ImageOps
from telethon.tl.types import DocumentAttributeFilename

from uniborg.util import mbl_cmd
from telethon import events


@borg.on(mbl_cmd(pattern="deepfry(?: |$)(.*)", outgoing=True))
async def deepfryer(event):
    try:
        frycount = int(event.pattern_match.group(1))
        if frycount < 1:
            raise ValueError
    except ValueError:
        frycount = 1

    if event.is_reply:
        reply_message = await event.get_reply_message()
        data = await check_media(reply_message)

        if isinstance(data, bool):
            await event.edit("`I can't deep fry that!`")
            return
Ejemplo n.º 4
0
import random
import requests
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern="quote ?(.*)"))
async def quote_search(event):
    if event.fwd_from:
        return
    await event.edit("Processing...")
    search_string = event.pattern_match.group(1)
    input_url = "https://bots.shrimadhavuk.me/Telegram/GoodReadsQuotesBot/?q={}".format(
        search_string)
    headers = {"USER-AGENT": "UniBorg"}
    try:
        response = requests.get(input_url, headers=headers).json()
    except:
        response = None
    if response is not None:
        result = random.choice(response).get("input_message_content").get(
            "message_text")
    else:
        result = None
    if result:
        await event.edit(result.replace("<code>", "`").replace("</code>", "`"))
    else:
        await event.edit("Zero results found")
Ejemplo n.º 5
0
"""
Available Commands:
.music"""

from telethon import events

import asyncio

from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern=r"music"))
async def _(event):

    if event.fwd_from:

        return

    animation_interval = 1.5

    animation_ttl = range(0, 11)

    # input_str = event.pattern_match.group(1)

    # if input_str == "music":

    await event.edit("music")

    animation_chars = [
        "РгцРгцРгц 81% РађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађ`Рюќ№ИЈ`\n\nРађРађРађРађРађ[cee jay Music Player](tg://user?id=1289422521)\n\nРађРађРађРађ**Now Playing:Kamasutra BGM**\n\n**00:00** Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒ **00:10**\n\nРађРађРађРађРађ`­Ъћѓ` `РЈ«№ИЈ` `РЈф№ИЈ` `РќХ№ИЈ` `РЈЕ№ИЈ` `РЈГ№ИЈ`\n\n**РађNext Song:** __I Am Sexy And I Know It.__\n\nРађРађРађРађ**РађDevice: I phone X**",
        "РгцРгцРгц 81% РађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађРађ`Рюќ№ИЈ`\n\nРађРађРађРађРађ[cee jay Music Player](tg://user?id=1289422521)\n\nРађРађРађРађ**Now Playing:Kamasutra BGM**\n\n**00:01** Рќ░Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒Рќ▒ **00:10**\n\nРађРађРађРађРађ`­Ъћѓ` `РЈ«№ИЈ` `РЈф№ИЈ` `РЈИ№ИЈ` `РЈЕ№ИЈ` `РЈГ№ИЈ`\n\n**РађNext Song:** __I Am Sexy And I Know It.__\n\nРађРађРађРађ**РађDevice: I phone X**",
Ejemplo n.º 6
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/.
"""WikiPedia.ORG
Syntax: .wikipedia Query"""
from telethon import events
import wikipedia
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern="wikipedia (.*)"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit("Processing ...")
    input_str = event.pattern_match.group(1)
    result = ""
    results = wikipedia.search(input_str)
    for s in results:
        page = wikipedia.page(s)
        url = page.url
        result += f"> [{s}]({url}) \n"
    await event.edit("WikiPedia **Search**: {} \n\n **Result**: \n\n{}".format(
        input_str, result))
Ejemplo n.º 7
0
"""CoinFlip for @UniBorg
Syntax: .coinflip [optional_choice]"""
from telethon import events
import random, re
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern="coin ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    r = random.randint(1, 100)
    input_str = event.pattern_match.group(1)
    if input_str:
        input_str = input_str.lower()
    if r % 2 == 1:
        if input_str == "heads":
            await event.edit(
                "The coin landed on: **Heads**. \n You were correct.")
        elif input_str == "tails":
            await event.edit(
                "The coin landed on: **Heads**. \n You weren't correct, try again ..."
            )
        else:
            await event.edit("The coin landed on: **Heads**.")
    elif r % 2 == 0:
        if input_str == "tails":
            await event.edit(
                "The coin landed on: **Tails**. \n You were correct.")
        elif input_str == "heads":
            await event.edit(
Ejemplo n.º 8
0
    output = file + ".jpg"
    metadata = extractMetadata(createParser(file))
    p = subprocess.Popen([
        'ffmpeg', '-i', file,
        '-ss', str(int((0, metadata.get('duration').seconds)[metadata.has('duration')] / 2)),
        # '-filter:v', 'scale={}:-1'.format(width),
        '-vframes', '1',
        output,
    ], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
    p.communicate()
    if not p.returncode and os.path.lexists(file):
        os.remove(file)
        return output


@borg.on(mbl_cmd(pattern="savethumbnail"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit("Processing ...")
    if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY):
        os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY)
    if event.reply_to_msg_id:
        downloaded_file_name = await borg.download_media(
            await event.get_reply_message(),
            Config.TMP_DOWNLOAD_DIRECTORY
        )
        if downloaded_file_name.endswith(".mp4"):
            downloaded_file_name = get_video_thumb(
                downloaded_file_name
            )
Ejemplo n.º 9
0
import bs4
import requests
import asyncio
import os
import re
import subprocess
import time
from datetime import datetime
from uniborg.util import mbl_cmd

langi = "en"


#kanged from Blank-x ;---;
@borg.on(mbl_cmd("imdb (.*)", outgoing=True))
async def imdb(e):
    try:
        movie_name = e.pattern_match.group(1)
        remove_space = movie_name.split(' ')
        final_name = '+'.join(remove_space)
        page = requests.get("https://www.imdb.com/find?ref_=nv_sr_fn&q=" +
                            final_name + "&s=all")
        lnk = str(page.status_code)
        soup = bs4.BeautifulSoup(page.content, 'lxml')
        odds = soup.findAll("tr", "odd")
        mov_title = odds[0].findNext('td').findNext('td').text
        mov_link = "http://www.imdb.com/" + odds[0].findNext('td').findNext(
            'td').a['href']
        page1 = requests.get(mov_link)
        soup = bs4.BeautifulSoup(page1.content, 'lxml')
Ejemplo n.º 10
0
Available Commands:

.deploy"""

from telethon import events

import asyncio

from uniborg.util import mbl_cmd

from userbot import AUTONAME

DEFAULTUSER = str(AUTONAME) if AUTONAME else "MBL User"


@borg.on(mbl_cmd(pattern=r"deploy"))
async def _(event):

    if event.fwd_from:

        return

    animation_interval = 10

    animation_ttl = range(0, 12)

    # input_str = event.pattern_match.group(1)

    await event.edit("Deploying...")

    animation_chars = [
Ejemplo n.º 11
0
import datetime
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd("mask ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    if not event.reply_to_msg_id:
        await event.edit("```Reply to any user message.```")
        return
    reply_message = await event.get_reply_message()
    if not reply_message.media:
        await event.edit("```reply to text message```")
        return
    chat = "@hazmat_suit_bot"
    sender = reply_message.sender
    if reply_message.sender.bot:
        await event.edit("```Reply to actual users message.```")
        return
    await event.edit("```Processing```")
    async with borg.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=905164246))
            await borg.send_message(chat, reply_message)
            response = await response
        except YouBlockedUserError:
Ejemplo n.º 12
0
"""Emoji

Available Commands:

.hypno"""

from telethon import events

import asyncio

from uniborg.util import mbl_cmd



@borg.on(mbl_cmd(pattern=r"hypno"))

async def _(event):

    if event.fwd_from:

        return

    animation_interval = 0.8

    animation_ttl = range(0, 15)

    #input_str = event.pattern_match.group(1)

    #if input_str == "hypno":
    
    #await event.edit(input_str)
Ejemplo n.º 13
0
"""File Converter
.nfc """

import asyncio
import os
import time
from datetime import datetime
from uniborg.util import mbl_cmd, progress


@borg.on(mbl_cmd(pattern="nfc (.*)"))  # 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.ctime()
        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
Ejemplo n.º 14
0
.weeb <text> """

from telethon import events
from uniborg.util import mbl_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'
]
weebyfont = [
    '卂', '乃', '匚', '刀', '乇', '下', '厶', '卄', '工', '丁', '长', '乚', '从', '𠘨', '口',
    '尸', '㔿', '尺', '丂', '丅', '凵', 'リ', '山', '乂', '丫', '乙'
]


@borg.on(mbl_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)
Ejemplo n.º 15
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]


@borg.on(mbl_cmd(pattern="yt(a|v) (.*)"))
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":
            "FFmpegMetadata",
Ejemplo n.º 16
0
""" @ukinti_bot
Available Commands:
.unbanall
.kick option
Available Options: d, y, m, w, o, q, r """
from telethon import events
from datetime import datetime, timedelta
from telethon.tl.types import UserStatusEmpty, UserStatusLastMonth, UserStatusLastWeek, UserStatusOffline, UserStatusOnline, UserStatusRecently, ChannelParticipantsKicked, ChatBannedRights
from telethon.tl import functions, types
from time import sleep
import asyncio
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern="unbanall ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    if input_str:
        logger.info("TODO: Not yet Implemented")
    else:
        if event.is_private:
            return False
        await event.edit("Searching Participant Lists.")
        p = 0
        async for i in borg.iter_participants(event.chat_id,
                                              filter=ChannelParticipantsKicked,
                                              aggressive=True):
            rights = ChatBannedRights(until_date=0, view_messages=False)
            try:
Ejemplo n.º 17
0
#By STARKTM1
from telethon import events
import asyncio
import os
import sys
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern=r"plane"))
async def _(event):
    if event.fwd_from:
        return

    await event.edit("✈-------------")
    await asyncio.sleep(1)
    await event.edit("-✈------------")
    await asyncio.sleep(1)
    await event.edit("--✈-----------")
    await asyncio.sleep(1)
    await event.edit("---✈----------")
    await asyncio.sleep(1)
    await event.edit("----✈---------")
    await asyncio.sleep(1)
    await event.edit("-----✈--------")
    await asyncio.sleep(1)
    await event.edit("------✈-------")
    await asyncio.sleep(1)
    await event.edit("-------✈------")
    await asyncio.sleep(1)
    await event.edit("--------✈-----")
    await asyncio.sleep(1)
Ejemplo n.º 18
0
"""Execute GNU/Linux commands inside Telegram
Syntax: .exec Code"""
# 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 telethon import events
import subprocess
from telethon.errors import MessageEmptyError, MessageTooLongError, MessageNotModifiedError
import io
import asyncio
import time
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern="exec ?(.*)"))
async def _(event):
    if event.fwd_from or event.via_bot_id:
        return
    DELAY_BETWEEN_EDITS = 0.3
    PROCESS_RUN_TIME = 100
    cmd = event.pattern_match.group(1)
    reply_to_id = event.message.id
    if event.reply_to_msg_id:
        reply_to_id = event.reply_to_msg_id
    start_time = time.time() + PROCESS_RUN_TIME
    process = await asyncio.create_subprocess_shell(
        cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
    stdout, stderr = await process.communicate()
    e = stderr.decode()
    if not e:
        e = "No Error"
Ejemplo n.º 19
0
# For Uniborg
# (c) @INF1N17Y

from telethon import events
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd("mention (.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        if previous_message.forward:
            replied_user = previous_message.forward.from_id
        else:
            replied_user = previous_message.from_id
    else:
        await event.edit("reply To Message")
    user_id = replied_user
    caption = """<a href='tg://user?id={}'>{}</a>""".format(user_id, input_str)
    await event.edit(caption, parse_mode="HTML")
Ejemplo n.º 20
0
"""Auto Profile Updation Commands
.autoname"""
from telethon import events
import asyncio
import time
from telethon.tl import functions
from telethon.errors import FloodWaitError
from uniborg.util import mbl_cmd
from userbot import ALIVE_NAME

DEL_TIME_OUT = 60
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "FRIDAY"


@borg.on(mbl_cmd(pattern="autoname"))  # 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")
        name = f"⌚{HM} 🔥{DEFAULTUSER}🔥 📅{DMY}"
        logger.info(name)
        try:
            await borg(
                functions.account.UpdateProfileRequest(  # pylint:disable=E0602
                    first_name=name))
        except FloodWaitError as ex:
            logger.warning(str(e))
            await asyncio.sleep(ex.seconds)
Ejemplo n.º 21
0
# (c) @UniBorg

from telethon import events
import asyncio
from collections import deque
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern=r"lol"))
async def _(event):
    if event.fwd_from:
        return
    deq = deque(list("😂🤣😂🤣😂🤣"))
    for _ in range(5):
        await asyncio.sleep(0.1)
        await event.edit("".join(deq))
        deq.rotate(1)
Ejemplo n.º 22
0
import re
import urllib.parse
from os import popen
from random import choice

import requests
from bs4 import BeautifulSoup

from humanize import naturalsize
from telethon import events
from telethon.tl import functions, types
from uniborg.util import mbl_cmd


#@borg.on(events.NewMessage(pattern=r"^.direct(?: |$)([\s\S]*)", outgoing=True))
@borg.on(mbl_cmd(pattern=r"direct(?: |$)([\s\S]*)"))
async def direct_link_generator(request):
    """ direct links generator """
    await request.edit("`Processing...`")
    textx = await request.get_reply_message()
    message = request.pattern_match.group(1)
    if message:
        pass
    elif textx:
        message = textx.text
    else:
        await request.edit("`Usage: .direct <url>`")
        return
    reply = ''
    links = re.findall(r'\bhttps?://.*\.\S+', message)
    if not links:
Ejemplo n.º 23
0
"""

from telethon import events

import asyncio

import os

import sys

import random

from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern=r"belo"))
async def _(event):

    if event.fwd_from:

        return

    await event.edit("Typing...")

    await asyncio.sleep(2)

    x = (random.randrange(1, 96))

    if x == 1:

        await event.edit(
Ejemplo n.º 24
0
"""Send Chat Actions
Syntax: .sca <option> <time in sec>
        sca options: Options for sca 

typing
contact
game
location
voice
round
video
photo
document
cancel"""

import asyncio
from uniborg.util import mbl_cmd
 
 
@borg.on(mbl_cmd("sca ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    await event.delete()
    input_str = event.pattern_match.group(1)
    action = "typing"
    if input_str:
        action = input_str
    async with borg.action(event.chat_id, action):
        await asyncio.sleep(86400)  # type for 10 seconds
Ejemplo n.º 25
0
"""
List Files plugin for userbot //Simple Module for people who dont wanna use shell executor for listing files.
cmd: .ls // will return files from current working directory
	 .ls path // will return output according to path  

By:- @Zero_cool7870

"""

from uniborg.util import mbl_cmd
import asyncio
import os


@borg.on(mbl_cmd(pattern="ls ?(.*)"))
async def lst(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    if input_str:
        msg = "**Files in {} :**\n".format(input_str)
        files = os.listdir(input_str)
    else:
        msg = "**Files in Current Directory :**\n"
        files = os.listdir(os.getcwd())
    for file in files:
        msg += "`{}`\n".format(file)
    if len(msg) <= Config.MAX_MESSAGE_SIZE_LIMIT:
        await event.edit(msg)
    else:
        msg = msg.replace("`", "")
Ejemplo n.º 26
0
#keep credit if u gonna edit or kang it 
#without creadit copy paster mc 
#creadits to  sawan(@veryhelpful) learned from kraken


import random, re
from uniborg.util import mbl_cmd
import asyncio
from telethon import events

@borg.on(mbl_cmd(pattern="mst ?(.*)"))
async def _(event):
     if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"):
        await event.edit("mst hu bbro ")
        await asyncio.sleep(1)
        await event.edit("╔═╦═╗╔══╗╔══╗\n║║║║║║══╣╚╗╔╝\n║║║║║╠══║─║║─\n╚╩═╩╝╚══╝─╚╝─")

@borg.on(mbl_cmd(pattern="gm ?(.*)"))
async def _(event):
     if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"):
        await event.edit("good morning ")
        await asyncio.sleep(1)
        await event.edit("╔══╗╔═╦═╗\n║╔═╣║║║║║\n║╚╗║║║║║║\n╚══╝╚╩═╩╝")

@borg.on(mbl_cmd(pattern="good ?(.*)"))
async def _(event):
     if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"):
        await event.edit("╔══╗╔═╗╔═╗╔══╗\n║╔═╣║║║║║║╚╗╗║\n║╚╗║║║║║║║╔╩╝║\n╚══╝╚═╝╚═╝╚══╝")

@borg.on(mbl_cmd(pattern="hhlo ?(.*)"))
async def _(event):
Ejemplo n.º 27
0
""".admin Plugin for @UniBorg"""
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern="admins"))
async def _(event):
    if event.fwd_from:
        return
    mentions = "@admin: **Spam Spotted**"
    chat = await event.get_input_chat()
    async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
        mentions += f"[\u2063](tg://user?id={x.id})"
    reply_message = None
    if event.reply_to_msg_id:
        reply_message = await event.get_reply_message()
        await reply_message.reply(mentions)
    else:
        await event.reply(mentions)
    await event.delete()
Ejemplo n.º 28
0
# All in one code.
"""
Available Commands:
.tlol
.lol
.heart
.candy
.nothappy"""

from telethon import events
import asyncio
from collections import deque
from uniborg.util import mbl_cmd


@borg.on(mbl_cmd(pattern=r"candy"))
async def _(event):
    if event.fwd_from:
        return
    deq = deque(list("🍦🍧🍩🍪🎂🍰🧁🍫🍬🍭"))
    for _ in range(999):
        await asyncio.sleep(1)
        await event.edit("".join(deq))
        deq.rotate(1)


@borg.on(mbl_cmd(pattern=r"nothappy"))
async def _(event):
    if event.fwd_from:
        return
    deq = deque(list("😁☹️😁☹️😁☹️😁"))
Ejemplo n.º 29
0
Online = Remove Offline Tag from your name and change profile pic to vars PROFILE_IMAGE.
Note - If you have a last name remove it unless it automatically removed.
"""

import os, urllib
from telethon import events
from telethon.tl import functions
from uniborg.util import mbl_cmd

OFFLINE_TAG = "[OFFLINE]"
ONLINE_TAG = "[ONLINE]"
PROFILE_IMAGE = os.environ.get(
    "PROFILE_IMAGE", "https://telegra.ph/file/9f0638dbfa028162a8682.jpg")


@borg.on(mbl_cmd(pattern="offline"))  # pylint:disable=E0602
async def _(event):
    if event.fwd_from:
        return
    user_it = "me"
    user = await event.client.get_entity(user_it)
    if user.first_name.startswith(OFFLINE_TAG):
        await event.edit("**Already in Offline Mode.**")
        return
    await event.edit("**Changing Profile to Offline...**")
    if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY):  # pylint:disable=E0602
        os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY)  # pylint:disable=E0602
    urllib.request.urlretrieve(
        "https://telegra.ph/file/249f27d5b52a87babcb3f.jpg", "donottouch.jpg")
    photo = "donottouch.jpg"
    if photo:
Ejemplo n.º 30
0
"""Use cmd `.cry` to cry"""

from telethon import events
from uniborg.util import mbl_cmd
import asyncio


@borg.on(mbl_cmd(pattern="lcry"))
async def _(event):

    if event.fwd_from:

        return

    animation_interval = 1

    animation_ttl = range(0, 103)

    await event.edit("crying")

    animation_chars = [
        ";__", ";___", ";____", ";_____", ";______", ";_______", ";________",
        ";__________", ";____________", ";______________", ";________________",
        ";__________________", ";____________________",
        ";______________________", ";________________________",
        ";_________________________", ";_________________________",
        ";________________________", ";_______________________",
        ";______________________", ";_____________________",
        ";____________________", ";___________________", ";__________________",
        ";_________________", ";________________", ";_______________",
        ";_____________", ";___________", ";_________", ";_______", ";_____",