import time from telethon.events import NewMessage from telethon.tl.custom import Dialog from telethon.tl.types import Channel, Chat, User from userbot import CMD_HELP from mafiabot.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="stats$")) @bot.on(sudo_cmd(pattern="stats$", allow_sudo=True)) async def stats( event: NewMessage.Event, ) -> None: # pylint: disable = R0912, R0914, R0915 """Command to get stats about the account""" mafia = await edit_or_reply(event, "`Collecting stats...`") start_time = time.time() private_chats = 0 bots = 0 groups = 0 broadcast_channels = 0 admin_in_groups = 0 creator_in_groups = 0 admin_in_broadcast_channels = 0 creator_in_channels = 0 unread_mentions = 0 unread = 0 dialog: Dialog async for dialog in event.client.iter_dialogs():
import asyncio import base64 import os from telethon import functions, types from telethon.tl.functions.messages import ImportChatInviteRequest as Get from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp from mafiabot.Config import Config LOGGER = Config.PLUGIN_CHANNEL SUDO_WALA = Config.SUDO_USERS @bot.on(admin_cmd(pattern="spam (.*)")) @bot.on(sudo_cmd(pattern="spam (.*)", allow_sudo=True)) async def spammer(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): message = e.text counter = int(message[6:8]) spam_message = str(e.text[8:]) await asyncio.wait([e.respond(spam_message) for i in range(counter)]) await e.delete() if LOGGER: await e.client.send_message( LOGGER_GROUP, "#SPAM \n\n" "Spam was executed successfully" ) @bot.on(admin_cmd(pattern="bigspam")) @bot.on(sudo_cmd(pattern="bigspam", allow_sudo=True))
import requests from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="ytube (.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="ytube (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) sample_url = ( "https://da.gd/s?url=https://www.youtube.com/results?search_query={}". format(input_str.replace(" ", "+"))) response_api = requests.get(sample_url).text if response_api: await edit_or_reply( event, "Let me **UThoob** that for you:\n👉 [{}]({})\n`Thank me later 😉` " .format(input_str, response_api.rstrip())) else: await edit_or_reply(event, "Something went wrong. Please try again later.") @bot.on(admin_cmd(pattern="ddg (.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="ddg (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return
import asyncio from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply @bot.on(admin_cmd(pattern="unoob$", outgoing=True)) @bot.on(sudo_cmd(pattern="unoob$", allow_sudo=True)) async def _(event): if event.fwd_from: return animation_interval = 0.5 animation_ttl = range(0, 9) await edit_or_reply(event, "You Noob") animation_chars = [ "EvErYbOdY", "iZ", "BiGGeSt", "NoOoB", "uNtiL", "YoU", "aRriVe", "😈", "EvErYbOdY iZ BiGGeSt NoOoB uNtiL YoU aRriVe 😈", ]
media = "Round Video" elif message and message.gif: media = "Gif" elif message and message.sticker: media = "Sticker" elif message and message.video: media = "Video" elif message and message.document: media = "Document" else: media = None return media @bot.on(admin_cmd(pattern="ffmpegsave$")) @bot.on(sudo_cmd(pattern="ffmpegsave$", allow_sudo=True)) async def ff_mpeg_trim_cmd(event): if event.fwd_from: return if not os.path.exists(FF_MPEG_DOWN_LOAD_MEDIA_PATH): reply_message = await event.get_reply_message() if reply_message: start = datetime.now() media = media_type(reply_message) if media not in ["Video", "Audio", "Voice", "Round Video", "Gif"]: return await edit_delete(event, "`Only media files are supported`", 5) mafiaevent = await edit_or_reply(event, "`Saving the file...`") try: c_time = time.time() downloaded_file_name = await event.client.download_media( reply_message,
import re import bs4 import requests from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="giz ?(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="giz ?(.*)", allow_sudo=True)) async def gizoogle(event): if event.fwd_from: return input_str = event.pattern_match.group(1) await edit_or_reply(event, "Processing...") if not input_str: return await edit_or_reply(event, "I can't gizoogle nothing.") else: try: result = text(input_str) except: result = "Failed to gizoogle the text." finally: return await edit_or_reply(event, 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)
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 uptime = get_readable_time((time.time() - StartTime)) @bot.on(admin_cmd(outgoing=True, pattern="mafia$")) @bot.on(sudo_cmd(pattern="mafia$", allow_sudo=True)) async def amireallyalive(alive): if alive.fwd_from: return reply_to_id = await reply_id(alive) if MAFIA_IMG: mafia_caption = f"**{CUSTOM_ALIVE_TEXT}**\n\n" mafia_caption += f"≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈\n" mafia_caption += f"__**𝔹𝕆𝕋 𝕊𝕋𝔸𝕋𝕌𝕊**__\n\n" mafia_caption += f"**★ 𝕋𝕖𝕝𝕖𝕥𝕙𝕠𝕟 𝕧𝕖𝕣𝕤𝕚𝕠𝕟 :** `1.15.0`\n" mafia_caption += f"**★ 𝕄𝔸𝔽𝕀𝔸𝔹𝕆𝕋 :**`{mafiaversion}`\n" mafia_caption += f"**★ 𝕌𝕡𝕥𝕚𝕞𝕖 :** `{uptime}\n`" mafia_caption += f"**★ 𝕄𝕒𝕤𝕥𝕖𝕣 :** {mention}\n" await alive.client.send_file( alive.chat_id, MAFIA_IMG, caption=mafia_caption, reply_to=reply_to_id
import asyncio from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=r"macos$", outgoing=True)) @bot.on(sudo_cmd(pattern=r"macos$", allow_sudo=True)) async def _(event): if event.fwd_from: return animation_interval = 0.5 animation_ttl = range(0, 11) await edit_or_reply(event, "Mac") animation_chars = [ "`Connecting To Hackintosh...`", "`Initiating Hackintosh Login.`", "`Loading Hackintosh... 0%\n▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Loading Hackintosh... 3%\n█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Loading Hackintosh... 9%\n██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Loading Hackintosh... 23%\n█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Loading Hackintosh... 39%\n█████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Loading Hackintosh... 69%\n█████████████▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Loading Hackintosh... 89%\n█████████████████████▒▒▒▒ `", "`Loading Hackintosh... 100%\n█████████████████████████ `",
from telethon.tl.types import ( ChannelParticipantsKicked, ChatBannedRights, UserStatusEmpty, UserStatusLastMonth, UserStatusLastWeek, UserStatusOffline, UserStatusOnline, UserStatusRecently, ) from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=r"unbanall ?(.*)")) @bot.on(sudo_cmd(pattern=r"unbanall ?(.*)", allow_sudo=True)) 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 edit_or_reply(event, "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)
"Ⓞ", "Ⓟ", "Ⓠ", "Ⓡ", "Ⓢ", "Ⓣ", "Ⓤ", "Ⓥ", "Ⓦ", "Ⓧ", "Ⓨ", "Ⓩ", ] @bot.on(admin_cmd(pattern="weeb(?: |$)(.*)", command="weeb")) @bot.on(sudo_cmd(pattern="weeb(?: |$)(.*)", command="weeb", allow_sudo=True)) async def weebify(event): if event.fwd_from: return args = event.pattern_match.group(1) if not args: get = await event.get_reply_message() args = get.text if not args: await edit_or_reply(event, "`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)
.shutdown""" # This Source Code Form is subject to the terms of the GNU # General Public License, v.3.0. If a copy of the GPL was not distributed with this # file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html import os import sys import asyncio from os import execl from time import sleep from mafiabot.utils import admin_cmd, sudo_cmd from userbot.cmdhelp import CmdHelp from userbot import HEROKU_APP, bot @bot.on(admin_cmd(pattern="restart")) @bot.on(sudo_cmd(pattern="restart", allow_sudo=True)) async def _(event): if event.fwd_from: return await event.edit("Restarting **[ ░░░ ]** ...\nType `.ping` or `.help` to check if I am working 🙂") await event.edit("Restarting **[ █░░ ]** ...\nType `.ping` or `.help` to check if I am working 🙂") await event.edit("Restarting **[ ██░ ]** ...\nType `.ping` or `.help` to check if I am working 🙂") await event.edit("Restarting **[ ███ ]** ...\nType `.ping` or `.help` to check if I am working 🙂") await event.edit("Restarted **[ ✓ ]** ...\nType `.ping` or `.help` to check if I am working 🙂") await bot.disconnect() os.execl(sys.executable, sys.executable, *sys.argv) quit() @bot.on(admin_cmd(pattern="shutdown$")) @bot.on(sudo_cmd(pattern="shutdown$", allow_sudo=True)) async def _(event):
# 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.tl.functions.messages import SaveDraftRequest from userbot import CMD_HELP from mafiabot.utils import admin_cmd, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="chain$")) @bot.on(sudo_cmd(pattern="chain$", allow_sudo=True)) async def _(event): if event.fwd_from: return await event.edit("Counting...") count = -1 message = event.message while message: reply = await message.get_reply_message() if reply is None: await event.client( SaveDraftRequest(await event.get_input_chat(), "", reply_to_msg_id=message.id)) message = reply count += 1 await event.edit(f"Chain length: {count}") CmdHelp("chain").add_command(
# '-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 @bot.on(admin_cmd(pattern="sthumb", outgoing=True)) @bot.on(sudo_cmd(pattern="sthumb", allow_sudo=True)) async def _(event): if event.fwd_from: return await edit_or_reply(event, "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) metadata = extractMetadata(createParser(downloaded_file_name)) height = 0 if metadata.has("height"): height = metadata.get("height")
import random import textwrap from PIL import Image, ImageDraw, ImageFont from telethon.tl.types import InputMessagesFilterDocument from userbot import bot from userbot.helpers.functions import deEmojify from mafiabot.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp # RegEx by https://t.me/c/1220993104/50065 @bot.on(admin_cmd(pattern="waifu(?: |$)(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="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 animu.edit( "`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( "stickerizerbot", f"#{random.choice(animus)}{(deEmojify(text))}") await sticcers[0].click(
return None except (TypeError, ValueError): await event.reply("`Invalid channel/group`") return None return chat_info 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 @bot.on(admin_cmd(pattern="inviteall ?(.*)")) @bot.on(sudo_cmd(pattern="inviteall ?(.*)", allow_sudo=True)) async def get_users(event): sender = await event.get_sender() me = await event.client.get_me() if not sender.id == me.id: mafia = await edit_or_reply(event, "`processing...`") else: mafia = await edit_or_reply(event, "`processing...`") kraken = await get_chatinfo(event) chat = await event.get_chat() if event.is_private: return await mafia.edit("`Sorry, Cant add users here`") s = 0 f = 0 error = "None"
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 uptime = get_readable_time((time.time() - StartTime)) @bot.on(admin_cmd(outgoing=True, pattern="Dark$")) @bot.on(sudo_cmd(pattern="Dark$", allow_sudo=True)) async def amireallyalive(alive): if alive.fwd_from: return reply_to_id = await reply_id(alive) if MAFIA_IMG: mafia_caption = f"**{CUSTOM_ALIVE_TEXT}**\n\n" mafia_caption += f"≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈\n" mafia_caption += f"__**𝔹𝕆𝕋 𝕊𝕋𝔸𝕋𝕌𝕊**__\n\n" mafia_caption += f"**★ 𝕋𝕖𝕝𝕖𝕥𝕙𝕠𝕟 𝕧𝕖𝕣𝕤𝕚𝕠𝕟 :** `1.15.0`\n" mafia_caption += f"**★ 𝔻𝔸ℝ𝕂𝔹𝕆𝕋 :**`{mafiaversion}`\n" mafia_caption += f"**★ 𝕌𝕡𝕥𝕚𝕞𝕖 :** `{uptime}\n`" mafia_caption += f"**★ 𝕄𝕒𝕤𝕥𝕖𝕣 :** {mention}\n" await alive.client.send_file(alive.chat_id, MAFIA_IMG,
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # """ Userbot plugin_info command """ from userbot import CMD_HELP from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=r"plinfo(?: |$)(.*)")) @bot.on(sudo_cmd(pattern=r"plinfo(?: |$)(.*)", allow_sudo=True)) async def info(event): """ For .plinfo command,""" args = event.pattern_match.group(1).lower() if args: if args in CmdHelp: await edit_or_reply(event, str(CmdHelp[args])) else: await edit_or_reply(event, "Please specify a valid plugin name.") else: await edit_or_reply( event, "Please specify which plugin do you want help for !!\ \nUsage: .plinfo <plugin name>") string = "" for i in CmdHelp: string += "`" + str(i) string += "`\n" await event.reply(string)
from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from mafiabot import bot, CmdHelp from mafiabot.utils import admin_cmd, edit_or_reply as eor, sudo_cmd @mafiabot.on(admin_cmd(pattern="history ?(.*)")) @mafiabot.on(sudo_cmd(pattern="history ?(.*)", allow_sudo=True)) async def _(mafiaevent): if mafiaevent.fwd_from: return if not mafiaevent.reply_to_msg_id: await eor(mafiaevent, "`Please Reply To A User To Get This Module Work`") return reply_message = await mafiaevent.get_reply_message() chat = "Sangmatainfo_bot" victim = reply_message.sender.id if reply_message.sender.bot: await eor(mafiaevent, "Need actual users. Not Bots") return await eor(mafiaevent, "Checking...") async with mafiaevent.client.conversation(chat) as conv: try: response1 = conv.wait_event( events.NewMessage(incoming=True, from_users=461843263)) response2 = conv.wait_event( events.NewMessage(incoming=True, from_users=461843263)) response3 = conv.wait_event( events.NewMessage(incoming=True, from_users=461843263))
# credits: @Mr_Hops from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from userbot import CMD_HELP from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="recognize ?(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="recognize ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await edit_or_reply(event, "Reply to any user's media message.") return reply_message = await event.get_reply_message() if not reply_message.media: await edit_or_reply(event, "reply to media file") return chat = "@Rekognition_Bot" reply_message.sender if reply_message.sender.bot: await edit_or_reply(event, "Reply to actual users message.") return mafia = await edit_or_reply(event, "recognizeing this media") async with event.client.conversation(chat) as conv: try: response = conv.wait_event(
import asyncio import os import time import zipfile from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply @bot.on(admin_cmd(pattern="compress ?(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="compress ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) mone = await edit_or_reply(event, "Processing ...") if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) if event.reply_to_msg_id: reply_message = await event.get_reply_message() try: time.time()
import asyncio from userbot import CMD_HELP from mafiabot.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=f"quickheal$", outgoing=True)) @bot.on(sudo_cmd(pattern=f"quickheal$", allow_sudo=True)) async def _(event): if event.fwd_from: return animation_interval = 5 animation_ttl = range(11) event = await edit_or_reply(event, "quickheal") animation_chars = [ "`Downloading File..`", "`File Downloaded....`", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 0%\n▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 4%\n█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 8%\n██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 20%\n█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 36%\n█████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 52%\n█████████████▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 84%\n█████████████████████▒▒▒▒ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 100%\n█████████████████████████ `", "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nTask: 01 of 01 Files Scanned...\n\nResult: No Virus Found...`", ] for i in animation_ttl: await asyncio.sleep(animation_interval) await event.edit(animation_chars[i % 11])
"""Get Poll Info on non supported clients Syntax: .get_poll""" from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="get_poll$", outgoing=True)) @bot.on(sudo_cmd(pattern="get_poll$", allow_sudo=True)) async def _(event): reply_message = await event.get_reply_message() if reply_message.media is None: await edit_or_reply( event, "Please reply to a media_type == @gPoll to view the questions and answers" ) elif reply_message.media.poll is None: await edit_or_reply( event, "Please reply to a media_type == @gPoll to view the questions and answers" ) else: media = reply_message.media poll = media.poll closed_status = poll.closed answers = poll.answers question = poll.question edit_caption = """Poll is Closed: {} Question: {} Answers: \n""".format(closed_status, question) if closed_status: results = media.results
from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from mafiabot.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd("circle ?(.*)")) @bot.on(sudo_cmd(pattern="circle ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await edit_or_reply(event, "Reply to any user message") return reply_message = await event.get_reply_message() if not reply_message.media: await edit_or_reply(event, "Reply to media message") return chat = "@TelescopyBot" reply_message.sender if reply_message.sender.bot: await edit_or_reply(event, "Reply to actual users message.") return kraken = await edit_or_reply(event, "Trying to convert...") async with event.client.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=397367589)) await event.client.send_message(chat, reply_message) response = await response
"""Emoji Available Commands: .wahack by © Thunder God Raiden """ import asyncio from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply @bot.on(admin_cmd(pattern=f"wahack", outgoing=True)) @bot.on(sudo_cmd(pattern=f"wahack", allow_sudo=True)) async def _(event): if event.fwd_from: return animation_interval = 2 animation_ttl = range(0, 15) # input_str = event.pattern_match.group(1) # if input_str == "wahack": await edit_or_reply(event, "wahack..") animation_chars = [ "Looking for WhatsApp databases in targeted person...", " User online: True\nTelegram access: True\nRead Storage: True ", "Hacking... 0%\n[░░░░░░░░░░░░░░░░░░░░]\n`Looking for WhatsApp...`\nETA: 0m, 20s", "Hacking... 11.07%\n[██░░░░░░░░░░░░░░░░░░]\n`Looking for WhatsApp...`\nETA: 0m, 18s", "Hacking... 20.63%\n[███░░░░░░░░░░░░░░░░░]\n`Found folder C:/WhatsApp`\nETA: 0m, 16s", "Hacking... 34.42%\n[█████░░░░░░░░░░░░░░░]\n`Found folder C:/WhatsApp`\nETA: 0m, 14s", "Hacking... 42.17%\n[███████░░░░░░░░░░░░░]\n`Searching for databases`\nETA: 0m, 12s",
] HIT = [ "hits", "whacks", "fek ke maari", "slaps", "smacks", "bashes", ] # =========================================== @bot.on(admin_cmd(pattern=r"(\w+)say (.*)")) @bot.on(sudo_cmd(pattern=r"(\w+)say (.*)", allow_sudo=True)) async def univsaye(cowmsg): """ For .cowsay module, userbot wrapper for cow which says things. """ if not cowmsg.text[0].isalpha() and cowmsg.text[0] not in ("/", "#", "@", "!"): arg = cowmsg.pattern_match.group(1).lower() text = cowmsg.pattern_match.group(2) if arg == "cow": arg = "default" if arg not in cow.COWACTERS: return cheese = cow.get_cow(arg) cheese = cheese() await edit_or_reply(cowmsg, f"`{cheese.milk(text).replace('`', '´')}`")
.tts LanguageCode as reply to a message .tts LangaugeCode | text to speak""" import asyncio import os import subprocess from datetime import datetime from gtts import gTTS from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=r"tts (.*)")) @bot.on(sudo_cmd(pattern=r"tts (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) start = datetime.now() if event.reply_to_msg_id: previous_message = await event.get_reply_message() text = previous_message.message lan = input_str elif "|" in input_str: lan, text = input_str.split("|") else: await edit_or_reply(event, "Invalid Syntax. Module stopping.") return text = text.strip()
# first userbot to port javes song module... # keep credit if u wanna kang... # else u are a gay...no doubt in that.... # Now in MafiaBot import asyncio import re from telethon.errors.rpcerrorlist import YouBlockedUserError from userbot import bot from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply, progress from userbot.cmdhelp import CmdHelp from userbot.helpers.functions import deEmojify @bot.on(admin_cmd(pattern="lyrics(?: |$)(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="lyrics(?: |$)(.*)", allow_sudo=True)) async def nope(h1m4n5hu0p): mafia = h1m4n5hu0p.pattern_match.group(1) if not mafia: if h1m4n5hu0p.is_reply: (await h1m4n5hu0p.get_reply_message()).message else: await h1m4n5hu0p.edit( "`Sir please give some query to search and download it for you..!`" ) return troll = await bot.inline_query("iLyricsBot", f"{(deEmojify(mafia))}") await troll[0].click( h1m4n5hu0p.chat_id,
.imdb """ import re import bs4 import requests from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp langi = "en" # kanged from Blank-x ;---; @bot.on(admin_cmd(pattern="imdb (.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="imdb (.*)", allow_sudo=True)) async def imdb(e): if e.fwd_from: return 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") 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"])
from telethon.tl.functions.channels import ( GetFullChannelRequest, GetParticipantsRequest, LeaveChannelRequest, ) from telethon.tl.functions.messages import GetFullChatRequest, GetHistoryRequest from telethon.tl.types import ChannelParticipantsAdmins, MessageActionChannelMigrateFrom from telethon.utils import get_input_location from userbot import CMD_HELP from mafiabot.utils import admin_cmd, errors_handler, sudo_cmd, edit_or_reply from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="chatinfo(?: |$)(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="chatinfo(?: |$)(.*)", allow_sudo=True)) async def info(event): if event.fwd_from: return await edit_or_reply(event, "`Analysing the chat...`") chat = await get_chatinfo(event) caption = await fetch_info(chat, event) try: await edit_or_reply(event, caption, parse_mode="html") except Exception as e: print("Exception:", e) await edit_or_reply(event, "`An unexpected error has occurred.`") return async def get_chatinfo(event):
import os from faker import Faker import datetime from telethon import functions, types, events from telethon.tl.functions.messages import DeleteHistoryRequest from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from mafiabot.utils import admin_cmd, sudo_cmd, edit_or_reply from mafiabot import CmdHelp, bot as mafiabot @mafiabot.on(admin_cmd("gencc$")) @mafiabot.on(sudo_cmd("gencc$", allow_sudo=True)) async def _(mafiaevent): if mafiaevent.fwd_from: return mafiacc = Faker() mafianame = mafiacc.name() mafiaadre = mafiacc.address() mafiacard = mafiacc.credit_card_full() await edit_or_reply( mafiaevent, f"__**👤 NAME :- **__\n`{mafianame}`\n\n__**🏡 ADDRESS :- **__\n`{mafiaadre}`\n\n__**💸 CARD :- **__\n`{mafiacard}`" ) @mafiabot.on(admin_cmd(pattern="bin ?(.*)")) @mafiabot.on(sudo_cmd(pattern="bin ?(.*)", allow_sudo=True)) async def _(event):