""" Spotify / Deezer downloader plugin by @anubisxx | Syntax: .sdd link""" import asyncio from telethon.errors.rpcerrorlist import ( UserAlreadyParticipantError, YouBlockedUserError, ) from telethon.tl.functions.messages import ImportChatInviteRequest from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("sdd ?(.*)")) async def _(event): if event.fwd_from: return d_link = event.pattern_match.group(1) if ".com" not in d_link: await event.edit("` I need a link to download something pro.`**(._.)**" ) else: await event.edit("🎶**Initiating Download!**🎶") async with borg.conversation("@DeezLoadBot") as conv: try: await conv.send_message("/start") await conv.get_response() try: await borg(ImportChatInviteRequest("AAAAAFZPuYvdW1A8mrT8Pg")) except UserAlreadyParticipantError:
import os from cryptosteganography import CryptoSteganography from telethon.tl.types import MessageMediaPhoto from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd, sudo_cmd sedpath = "./fridaydevs/" if not os.path.isdir(sedpath): os.makedirs(sedpath) @friday.on(friday_on_cmd(pattern=r"stegano ?(.*)")) @friday.on(sudo_cmd(pattern=r"stegano ?(.*)", allow_sudo=True)) async def hmm(event): if not event.reply_to_msg_id: await event.reply("Reply to any Image.") return await event.edit("hmm... Hiding Text Inside Image...") sed = await event.get_reply_message() if isinstance(sed.media, MessageMediaPhoto): img = await borg.download_media(sed.media, sedpath) elif "image" in sed.media.document.mime_type.split("/"): img = await borg.download_media(sed.media, sedpath) else: await event.edit("Reply To Image") return text = event.pattern_match.group(1) if not text: await event.edit("No input found! --__--")
if seconds == 0 and remainder == 0: break 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 @friday.on(friday_on_cmd(pattern="ping$")) async def _(event): starkislub = await edit_or_reply(event, "`Pong !`") if event.fwd_from: return start = datetime.now() end = datetime.now() ms = (end - start).microseconds / 1000 uptime = get_readable_time((time.time() - Lastupdate)) await starkislub.edit( f"**🙈වැඩ වැඩ මහත්තයෝ⚙🔧** \n **ᵐʸ ᶜᵘʳʳᵉⁿᵗ ᵖᶦⁿᵍʳᵃᵗᵉ**👇 \n \n ⚡️ `{ms}` \n ⚡️ `{uptime}`" ) else: def get_readable_time(seconds: int) -> str:
MessageMediaPhoto, ) from virtualuserbot import ALIVE_NAME, CMD_HELP from virtualuserbot.function import convert_to_image from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd sedpath = Config.TMP_DOWNLOAD_DIRECTORY if not os.path.isdir(sedpath): os.makedirs(sedpath) DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Who is this" FILLED_UP_DADDY = "Invalid pack selected." @friday.on(friday_on_cmd(pattern="kang ?(.*)")) @friday.on(sudo_cmd(pattern="kang ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await event.edit("PLease, Reply To A Sticker / Image To Add It Your Pack") return if not event.is_reply: await moods.edit("Reply to a photo to add to my personal sticker pack.") return reply_message = await event.get_reply_message() sticker_emoji = await get_sticker_emoji(event) input_str = event.pattern_match.group(1) if input_str: sticker_emoji = input_str
"""command: .abusehin , .abusemal""" #!/usr/bin/env python3 # -*- coding: utf-8 -*- import random from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern=r"habuse(.*)", outgoing=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) if input_str in "hin": emoticons = [ "Maderchod- M**********R", "Bhosadike-BORN FROM A ROTTEN PUSSY", "Bhen chod-Sister f****r", "Bhadhava- Pimp", "Bhadhava- Pimp", "Chodu- F****r", "Chutiya- F****r, bastard", "Gaand- ASS", "Gaandu-Asshole", "Gadha, Bakland- Idiot", "Lauda, Lund- Penis, dick, c**k", "Hijra- Gay, Transsexual", "Kuttiya- Bitch", "Paad- FART",
import html from telethon.tl.functions.photos import GetUserPhotosRequest from telethon.tl.functions.users import GetFullUserRequest from telethon.tl.types import MessageEntityMentionName from telethon.utils import get_input_location from virtualuserbot import CMD_HELP, sclient from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("info ?(.*)")) @friday.on(sudo_cmd("info ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return replied_user, error_i_a = await get_full_user(event) if replied_user is None: await edit_or_reply(event, str(error_i_a)) return False replied_user_profile_photos = await borg( GetUserPhotosRequest(user_id=replied_user.user.id, offset=42, max_id=0, limit=80)) replied_user_profile_photos_count = "None" try: replied_user_profile_photos_count = replied_user_profile_photos.count except AttributeError: pass user_id = replied_user.user.id
# 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.events import ChatAction, NewMessage from telethon.tl.types import MessageEntityMentionName from virtualuserbot import CMD_HELP from virtualuserbot.function import get_all_admin_chats, is_admin from virtualuserbot.modules.sql_helper import gban_sql from virtualuserbot.modules.sql_helper.mute_sql import is_muted, mute, unmute from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="gban(?: |$)(.*)")) async def gbun(event): await event.edit("**GBanning User**") sucess = 0 bad = 0 user, reason = await get_user_from_event(event) if not user.id: await event.edit("`Mention A User To Gban`") return if not reason: hmm_r = "#GBanned" elif reason: hmm_r = reason if user.id == bot.uid: await event.edit("**I Can't Gban You Master :(**") return
# Modded from dagd.py """ Animate How To Google Command .ggl Search Query By @loxxi """ import requests from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_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**\
from datetime import datetime import requests from bs4 import BeautifulSoup from google_images_download import google_images_download from virtualuserbot import CMD_HELP from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd def progress(current, total): logger.info("Downloaded {} of {}\nCompleted {}".format( current, total, (current / total) * 100)) @friday.on(friday_on_cmd(pattern="search (.*)")) @friday.on(sudo_cmd(pattern="search (.*)", allow_sudo=True)) async def _(event): stark = await edit_or_reply(event, "`Processing Your Request`") if event.fwd_from: return start = datetime.now() await stark.edit("`Trying To Connect...`") # SHOW_DESCRIPTION = False input_str = event.pattern_match.group( 1 ) # + " -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" (mkv|mp4|avi|epub|pdf|mp3)" input_url = "https://bots.shrimadhavuk.me/search/?q={}".format(input_str) headers = {"USER-AGENT": "UniBorg"} response = requests.get(input_url, headers=headers).json() output_str = " "
# 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 pyjokes from howdoi import howdoi from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern=r"pjoke")) async def hi(event): if event.fwd_from: return await event.edit(pyjokes.get_joke(category="all")) @friday.on(friday_on_cmd(pattern="howdoi ?(.*)")) async def __(event): query = event.pattern_match.group(1) if query == None: await event.edit("`Give Some Query First`") return output = howdoi.howdoi(query) lel = f"<b><u>Here is Your Answer</b></u> \n<code>{output}</code>" await event.edit(lel, parse_mode="HTML")
# For UniBorg # By Priyam Kalra # Syntax (.hl <link>) from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="hl ?(.*)")) async def _(event): if event.fwd_from: return input = event.pattern_match.group(1) await event.edit("[ㅤㅤㅤㅤㅤㅤㅤ](" + input + ")") CMD_HELP.update({ "hyperlink": "**Hyperlink**\ \n\n**Syntax : **`.hl <link>`\ \n**Usage :** Creates a hyperlink with given link." })
return await event.edit("Something Went Wrong", str(err)) return user_obj, extra async def get_user_sender_id(user, event): if isinstance(user, str): user = int(user) try: user_obj = await event.client.get_entity(user) except (TypeError, ValueError) as err: await event.edit(str(err)) return None return user_obj @friday.on(friday_on_cmd(pattern="ultragban ?(.*)")) async def gspider(virtualuserbot): lol = virtualuserbot sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: friday = await lol.reply("Gbanning This User !") else: friday = await lol.edit("Wait Processing.....") me = await virtualuserbot.client.get_me() await friday.edit(f"Global Ban Is Coming ! Wait And Watch You N***a") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await virtualuserbot.get_chat() a = b = 0 if virtualuserbot.is_private:
import asyncio from datetime import datetime from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd, sudo_cmd fridaythumb = "./resources/IMG_20200929_103719_628.jpg" @friday.on(friday_on_cmd(pattern="send ?(.*)")) @friday.on(sudo_cmd(pattern="send ?(.*)", allow_sudo=True)) async def send(event): if event.fwd_from: return message_id = event.message.id input_str = event.pattern_match.group(1) start = datetime.now() the_plugin_file = "./virtualuserbot/modules/{}.py".format(input_str) end = datetime.now() (end - start).seconds men = f"Plugin Name - {input_str}.py \nUploaded By VirtualUserbot" await event.client.send_file( # pylint:disable=E0602 event.chat_id, the_plugin_file, thumb=fridaythumb, caption=men, force_document=True, allow_cache=False, reply_to=message_id, ) await asyncio.sleep(5)
from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd telegraph = Telegraph() r = telegraph.create_account(short_name=Config.TELEGRAPH_SHORT_NAME) auth_url = r["auth_url"] if Config.PRIVATE_GROUP_ID is None: BOTLOG = False else: BOTLOG = True BOTLOG_CHATID = Config.PRIVATE_GROUP_ID @friday.on(friday_on_cmd(pattern="telegraph (media|text) ?(.*)")) async def _(event): if event.fwd_from: return if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) if BOTLOG: await borg.send_message( Config.PRIVATE_GROUP_ID, "Created New Telegraph account {} for the current session. \n**Do not give this url to anyone, even if they say they are from Telegram!**" .format(auth_url), ) optional_title = event.pattern_match.group(2) if event.reply_to_msg_id: start = datetime.now() r_message = await event.get_reply_message()
"""Take screenshot of any website Syntax: .screencapture <Website URL>""" import io import requests from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_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)
# @FridayoT import requests from iplookup import iplookup from selenium import webdriver from youtube_search import YoutubeSearch from virtualuserbot import CMD_HELP from virtualuserbot.function import apk_dl from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="wshot ?(.*)")) @friday.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 @VirtualUserbot\nThanks to @FridayOT**", )
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] @friday.on(friday_on_cmd(pattern="download(?: |$)(.*)")) @friday.on(sudo_cmd(pattern="download(?: |$)(.*)", allow_sudo=True)) async def download(target_file): if target_file.fwd_from: return friday = await edit_or_reply(target_file, "`Processing ...`") await friday.edit("Processing using virtualuserbot server ( ◜‿◝ )♡") if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY): os.makedirs(TEMP_DOWNLOAD_DIRECTORY) if not target_file.reply_to_msg_id: await friday.edit( "`Reply to a message to download to my local server.`") return sedd = await target_file.get_reply_message() if not sedd.media: await event.edit("`I Can Only Download Media As For Now.`")
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(friday_on_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(
""" Get the Bots in any chat* Syntax: .get_bot""" from telethon.tl.types import ChannelParticipantAdmin, ChannelParticipantsBots from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_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 )
"""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 virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_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() CMD_HELP.update({ "fwd":
"""Default Permission in Telegram 5.0.1 Available Commands: .lock <option>, .unlock <option>, .locks API Options: msg, media, sticker, gif, gamee, ainline, gpoll, adduser, cpin, changeinfo DB Options: bots, commands, email, forward, url""" from telethon import events, functions, types from virtualuserbot.modules.sql_helper.locks_sql import ( get_locks, is_locked, update_lock, ) from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("lock( (?P<target>\S+)|$)")) @friday.on(sudo_cmd("lock( (?P<target>\S+)|$)", allow_sudo=True)) async def _(event): mrhackerguy = await edit_or_reply(event, "Processing") # Space weirdness in regex required because argument is optional and other # commands start with ".lock" if event.fwd_from: return input_str = event.pattern_match.group("target") peer_id = event.chat_id if input_str in (("bots", "commands", "email", "forward", "url")): update_lock(peer_id, input_str, True) await mrhackerguy.edit("Locked {}".format(input_str)) else: msg = None media = None
import random from time import sleep from urllib.parse import quote_plus from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from virtualuserbot import CHROME_DRIVER, CMD_HELP, GOOGLE_CHROME_BIN from virtualuserbot.utils import friday_on_cmd CARBONLANG = "auto" LANG = "en" @friday.on(friday_on_cmd(pattern="carbon")) async def carbon_api(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): """A Wrapper for carbon.now.sh""" await e.edit("`Processing..`") CARBON = "https://carbon.now.sh/?l={lang}&code={code}" global CARBONLANG textx = await e.get_reply_message() pcode = e.text if pcode[8:]: pcodee = str(pcode[8:]) if "|" in pcodee: pcode, skeme = pcodee.split("|") else: pcode = pcodee
from datetime import datetime from virtualuserbot.utils import edit_or_reply, friday_on_cmd @friday.on(friday_on_cmd("gettime ?(.*)")) # pylint:disable=E0602 async def gn(event): if event.fwd_from: return current_time = datetime.now().strftime( "CURRENT DATE & TIME \nLOCATION: Sri Lanka \nTime: %H:%M:%S \nDate: %d.%m.%y" ) datetime.now() input_str = event.pattern_match.group(1) event.message.id if input_str: current_time = input_str elif event.reply_to_msg_id: previous_message = await event.get_reply_message() previous_message.id await edit_or_reply( event, current_time, )
# 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/. """Urban Dictionary Syntax: .ud Query""" import urbandict from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("ud (.*)")) async def _(event): if event.fwd_from: return await event.edit("processing...") str = event.pattern_match.group(1) try: mean = urbandict.define(str) if len(mean) > 0: await event.edit("Text: **" + str + "**\n\nMeaning: **" + mean[0]["def"] + "**\n\n" + "Example: \n__" + mean[0]["example"] + "__") else: await event.edit("No result found for **" + str + "**") except: await event.edit("No result found for **" + str + "**") CMD_HELP.update({ "urbandictionary":
from glitch_this import ImageGlitcher from telethon.tl.types import MessageMediaPhoto from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_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) @friday.on(friday_on_cmd(pattern=r"glitch")) @friday.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 isinstance(sed.media, MessageMediaPhoto): photolove = await borg.download_media(sed.media, sedpath) elif "image" in sed.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/@fridayot.{fmt}" glitch_imgs = glitcher.glitch_image(photolove, 2,
import asyncio from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("gangasta ?(.*)")) async def _(event): if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): await event.edit("EVERyBOdy") await asyncio.sleep(0.3) await event.edit("iZ") await asyncio.sleep(0.2) await event.edit("GangSTur") await asyncio.sleep(0.5) await event.edit("UNtIL ") await asyncio.sleep(0.2) await event.edit("I") await asyncio.sleep(0.3) await event.edit("ArRivE") await asyncio.sleep(0.3) await event.edit("🔥🔥🔥") await asyncio.sleep(0.3) await event.edit("EVERyBOdy iZ GangSTur UNtIL I ArRivE 🔥🔥🔥") CMD_HELP.update({ "gangasta": "**Gangasta**\ \n\n**Syntax : **`.gangasta`\
"""Get weather data using OpenWeatherMap Syntax: .weather <Location> .wttr <location> """ import io import time import aiohttp from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="weathers (.*)")) async def _(event): if event.fwd_from: return sample_url = ( "https://api.openweathermap.org/data/2.5/weather?q={}&APPID={}&units=metric" ) input_str = event.pattern_match.group(1) async with aiohttp.ClientSession() as session: response_api_zero = await session.get( sample_url.format(input_str, Config.OPEN_WEATHER_MAP_APPID) ) response_api = await response_api_zero.json() if response_api["cod"] == 200: country_code = response_api["sys"]["country"] country_time_zone = int(response_api["timezone"]) sun_rise_time = int(response_api["sys"]["sunrise"]) + country_time_zone sun_set_time = int(response_api["sys"]["sunset"]) + country_time_zone
import re import urllib import requests from bs4 import BeautifulSoup from PIL import Image from virtualuserbot import CMD_HELP, bot from virtualuserbot.utils import errors_handler, friday_on_cmd opener = urllib.request.build_opener() useragent = "Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36" opener.addheaders = [("User-agent", useragent)] @friday.on(friday_on_cmd(outgoing=True, pattern=r"reverse(?: |$)(\d*)")) @errors_handler async def okgoogle(img): """ For .reverse command, Google search images and stickers. """ if os.path.isfile("okgoogle.png"): os.remove("okgoogle.png") message = await img.get_reply_message() if message and message.media: photo = io.BytesIO() await bot.download_media(message, photo) else: await img.edit("`Reply to photo or sticker nigger.`") return if photo:
# Lel, Didn't Get Time To Make New One So Used Plugin Made br @mrconfused and @sandy1709 dont edit credits import io import os import lyricsgenius from tswift import Song from virtualuserbot import CMD_HELP from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd GENIUS = os.environ.get("GENIUS_API_TOKEN", None) @friday.on(friday_on_cmd(outgoing=True, pattern="lyrics (.*)")) @friday.on(sudo_cmd(pattern="lyrics (.*)", allow_sudo=True)) async def _(event): await edit_or_reply(event, "Searching For Lyrics.....") reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id reply = await event.get_reply_message() if event.pattern_match.group(1): query = event.pattern_match.group(1) elif reply.text: query = reply.message else: await edit_or_reply(event, "`What I am Supposed to find `") return song = "" song = Song.find_song(query)
# For @UniBorg # courtesy Yasir siddiqui """Self Destruct Plugin .sd <time in seconds> <text> """ import time from virtualuserbot import CMD_HELP from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("sd", outgoing=True)) async def selfdestruct(destroy): """For .sd command, make seflf-destructable messages.""" if not destroy.text[0].isalpha() and destroy.text[0] not in ("/", "#", "@", "!"): message = destroy.text counter = int(message[4:6]) text = str(destroy.text[6:]) text = (text + "\n\n`This message shall be self-destructed in " + str(counter) + " seconds`") await destroy.delete() smsg = await destroy.client.send_message(destroy.chat_id, text) time.sleep(counter) await smsg.delete() CMD_HELP.update({ "selfdestruct": "**Self destruct**\