async def DeezLoader(Deezlod): if Deezlod.fwd_from: return d_link = Deezlod.pattern_match.group(1) if ".com" not in d_link: await Deezlod.edit( "` I need a link to download something pro.`**(._.)**") else: await Deezlod.edit("**Initiating Download!**") chat = "@DeezLoadBot" async with bot.conversation(chat) as conv: try: msg_start = await conv.send_message("/start") response = await conv.get_response() r = await conv.get_response() msg = await conv.send_message(d_link) details = await conv.get_response() song = await conv.get_response() """ - don't spam notif - """ await bot.send_read_acknowledge(conv.chat_id) except YouBlockedUserError: await Deezlod.edit("**Error:** `unblock` @DeezLoadBot `and retry!`" ) return await bot.send_file(Deezlod.chat_id, song, caption=details.text) await Deezlod.client.delete_messages( conv.chat_id, [msg_start.id, response.id, r.id, msg.id, details.id, song.id]) await Deezlod.delete()
async def getmusic(so): if so.fwd_from: return await so.client(JoinChannelRequest("t.me/anitimeofficial")) song = so.pattern_match.group(1) chat = "@SongsForYouBot" link = f"/song {song}" await so.edit("🔹Ok wait... 📡Searching your song🔸") async with bot.conversation(chat) as conv: await asyncio.sleep(2) await so.edit("📥Downloading...Please wait🤙") try: msg = await conv.send_message(link) response = await conv.get_response() respond = await conv.get_response() """ - don't spam notif - """ await bot.send_read_acknowledge(conv.chat_id) except YouBlockedUserError: await so.edit( "Please unblock @SongsForYouBot and try searching again🤐") return await so.edit("Ohh.. I got something!! Wait sending😋🤙") await asyncio.sleep(3) await bot.send_file(so.chat_id, respond) await so.client.delete_messages(conv.chat_id, [msg.id, response.id, respond.id]) await so.delete()
async def _(event): if event.fwd_from: return await event.edit(f"**STARTING DYNAMICS BAN BY {PRO}**...") fedList = [] if event.reply_to_msg_id: previous_message = await event.get_reply_message() if previous_message.media: downloaded_file_name = await bot.download_media( previous_message, "fedlist" ) await asyncio.sleep(6) file = open(downloaded_file_name, "r") lines = file.readlines() for line in lines: try: fedList.append(line[:36]) except BaseException: pass arg = event.text.split(" ", maxsplit=2) if len(arg) > 2: FBAN = arg[1] REASON = arg[2] else: FBAN = arg[1] REASON = " #DYNAMICS FBANNED🔥 " else: FBAN = previous_message.sender_id REASON = event.text.split(" ", maxsplit=1)[1] if REASON.strip() == "": REASON = " #DYNAMICS FBANNED 🔥" else: arg = event.text.split(" ", maxsplit=2) if len(arg) > 2: FBAN = arg[1] REASON = arg[2] else: FBAN = arg[1] REASON = " #DYNAMICS FBANNED 🔥 " try: int(FBAN) if int(FBAN) == 1281934570 or int(FBAN) == 1100231654: await event.edit("BHAAG BETICHOD APNE BAAP KO FBAN DEGA") return except BaseException: if FBAN == "@PROBOYX" or FBAN == "@DYNAMICX22": await event.edit("NIKAL LAWDE TUJHE HI SUPER FBAN KRRAHAHU.") return if Config.FBAN_GROUP_ID: chat = Config.FBAN_GROUP_ID else: chat = await event.get_chat() if not len(fedList): for a in range(3): async with bot.conversation("@MissRose_bot") as bot_conv: await bot_conv.send_message("/start") await bot_conv.send_message("/myfeds") await asyncio.sleep(3) response = await bot_conv.get_response() await asyncio.sleep(3) if "make a file" in response.text: await asyncio.sleep(6) await response.click(0) await asyncio.sleep(6) fedfile = await bot_conv.get_response() await asyncio.sleep(3) if fedfile.media: downloaded_file_name = await bot.download_media( fedfile, "fedlist" ) await asyncio.sleep(6) file = open(downloaded_file_name, "r") lines = file.readlines() for line in lines: try: fedList.append(line[:36]) except BaseException: pass else: return if len(fedList) == 0: await event.edit(f"WAIT MASTER I AM CHECKING {PRO} ALL FEDS GIVE ME TIME ({a+1}/3)...") else: break else: await event.edit(f"Error") if "You can only use fed commands once every 5 minutes" in response.text: await event.edit("Try again after 5 mins.") return In = False tempFedId = "" for x in response.text: if x == "`": if In: In = False fedList.append(tempFedId) tempFedId = "" else: In = True elif In: tempFedId += x if len(fedList) == 0: await event.edit("Something went wrong.") return await event.edit(f"FBANNING IN {len(fedList)} BY {PRO} 🔥.") try: await bot.send_message(chat, f"/start") except BaseException: await event.edit("FBAN_GROUP_ID is incorrect.") return await asyncio.sleep(3) if Config.EXCLUDE_FED: excludeFed = Config.EXCLUDE_FED.split("|") for n in range(len(excludeFed)): excludeFed[n] = excludeFed[n].strip() exCount = 0 for fed in fedList: if Config.EXCLUDE_FED and fed in excludeFed: await bot.send_message(chat, f"{fed} Excluded.") exCount += 1 continue await bot.send_message(chat, f"/joinfed {fed}") await asyncio.sleep(3) await bot.send_message(chat, f"/fban {FBAN} {REASON}") await asyncio.sleep(3) await event.edit( f"SuperFBan Completed. Affected {len(fedList) - exCount} feds.\n#DYNAMIC BOT" )
async def _(event): if event.fwd_from: return await event.edit(f"**STARTING DYNAMICS UNFBANNING BY {PRO}**...") if event.reply_to_msg_id: previous_message = await event.get_reply_message() FBAN = previous_message.sender_id else: FBAN = event.pattern_match.group(1) if Config.FBAN_GROUP_ID: chat = Config.FBAN_GROUP_ID else: chat = await event.get_chat() fedList = [] for a in range(3): async with bot.conversation("@MissRose_bot") as bot_conv: await bot_conv.send_message("/start") await bot_conv.send_message("/myfeds") response = await bot_conv.get_response() if "make a file" in response.text: await asyncio.sleep(3) await response.click(0) fedfile = await bot_conv.get_response() if fedfile.media: downloaded_file_name = await bot.download_media( fedfile, "fedlist" ) file = open(downloaded_file_name, "r") lines = file.readlines() for line in lines: fedList.append(line[: line.index(":")]) else: return if len(fedList) == 0: await event.edit(f"FINDING {PRO} ALL FEDS GIVE ME SOME TIME({a+1}/3)...") else: break else: await event.edit(f"Error") if "You can only use fed commands once every 5 minutes" in response.text: await event.edit("Try again after 5 mins.") return In = False tempFedId = "" for x in response.text: if x == "`": if In: In = False fedList.append(tempFedId) tempFedId = "" else: In = True elif In: tempFedId += x await event.edit(f"UNFBANNING IN {len(fedList)} FEDS BY {PRO}.") try: await bot.send_message(chat, f"/start") except BaseException: await event.edit("FBAN_GROUP_ID is incorrect.") return await asyncio.sleep(5) for fed in fedList: await bot.send_message(chat, f"/joinfed {fed}") await asyncio.sleep(5) await bot.send_message(chat, f"/unfban {FBAN}") await asyncio.sleep(5) await event.edit(f"SuperUnFBan Completed. Affected {len(fedList)} Feds by {PRO}.\n#DYNAMICBOT")
async def kang(args): """ For .kang command, kangs stickers or creates new ones. """ user = await bot.get_me() if not user.username: user.username = user.first_name message = await args.get_reply_message() photo = None emojibypass = False is_anim = False emoji = None if message and message.media: if isinstance(message.media, MessageMediaPhoto): await args.edit(f"`{random.choice(KANGING_STR)}`") photo = io.BytesIO() photo = await bot.download_media(message.photo, photo) elif "image" in message.media.document.mime_type.split('/'): await args.edit(f"`{random.choice(KANGING_STR)}`") photo = io.BytesIO() await bot.download_file(message.media.document, photo) if (DocumentAttributeFilename(file_name='sticker.webp') in message.media.document.attributes): emoji = message.media.document.attributes[1].alt emojibypass = True elif "tgsticker" in message.media.document.mime_type: await args.edit(f"`{random.choice(KANGING_STR)}`") await bot.download_file(message.media.document, 'AnimatedSticker.tgs') attributes = message.media.document.attributes for attribute in attributes: if isinstance(attribute, DocumentAttributeSticker): emoji = attribute.alt emojibypass = True is_anim = True photo = 1 else: await args.edit("`Unsupported File!`") return else: await args.edit("`I can't kang that...`") return if photo: splat = args.text.split() if not emojibypass: emoji = "😎" pack = 1 if len(splat) == 3: pack = splat[2] # User sent both emoji = splat[1] elif len(splat) == 2: if splat[1].isnumeric(): # User wants to push into different pack, but is okay with # thonk as emote. pack = int(splat[1]) else: # User sent just custom emote, wants to push to default # pack emoji = splat[1] packname = f"{user.username}_{pack}" packnick = f"@{user.username}'s_{pack}" cmd = '/newpack' file = io.BytesIO() if not is_anim: image = await resize_photo(photo) file.name = "sticker.png" image.save(file, "PNG") else: packname += "_anim" packnick += " (Animated)" cmd = '/newanimated' response = urllib.request.urlopen( urllib.request.Request(f'http://t.me/addstickers/{packname}')) htmlstr = response.read().decode("utf8").split('\n') if " A <strong>Telegram</strong> user has created the <strong>Sticker Set</strong>." not in htmlstr: async with bot.conversation('Stickers') as conv: await conv.send_message('/addsticker') await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.send_message(packname) x = await conv.get_response() while "120" in x.text: pack += 1 packname = f"{user.username}_{pack}" packnick = f"@{user.username}'s_{pack}" await args.edit("`Switching to Pack " + str(pack) + " due to insufficient space`") await conv.send_message(packname) x = await conv.get_response() if x.text == "Invalid pack selected.": await conv.send_message(cmd) await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.send_message(packnick) await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) if is_anim: await conv.send_file('AnimatedSticker.tgs') remove('AnimatedSticker.tgs') else: file.seek(0) await conv.send_file(file, force_document=True) await conv.get_response() await conv.send_message(emoji) # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message("/publish") if is_anim: await conv.get_response() await conv.send_message(f"<{packnick}>") # Ensure user doesn't get spamming notifications await conv.get_response() await bot.send_read_acknowledge(conv.chat_id) await conv.send_message("/skip") # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message(packname) # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await args.edit(f"`Sticker added in a Different Pack !\ \nThis Pack is Newly created!\ \nYour pack can be found [here](t.me/addstickers/{packname})", parse_mode='md') return if is_anim: await conv.send_file('AnimatedSticker.tgs') remove('AnimatedSticker.tgs') else: file.seek(0) await conv.send_file(file, force_document=True) rsp = await conv.get_response() if "Sorry, the file type is invalid." in rsp.text: await args.edit( "`Failed to add sticker, use` @Stickers `bot to add the sticker manually.`" ) return await conv.send_message(emoji) # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message('/done') await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) else: await args.edit("`Brewing a new Pack...`") async with bot.conversation('Stickers') as conv: await conv.send_message(cmd) await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.send_message(packnick) await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) if is_anim: await conv.send_file('AnimatedSticker.tgs') remove('AnimatedSticker.tgs') else: file.seek(0) await conv.send_file(file, force_document=True) rsp = await conv.get_response() if "Sorry, the file type is invalid." in rsp.text: await args.edit( "`Failed to add sticker, use` @Stickers `bot to add the sticker manually.`" ) return await conv.send_message(emoji) # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message("/publish") if is_anim: await conv.get_response() await conv.send_message(f"<{packnick}>") # Ensure user doesn't get spamming notifications await conv.get_response() await bot.send_read_acknowledge(conv.chat_id) await conv.send_message("/skip") # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() await conv.send_message(packname) # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await conv.get_response() # Ensure user doesn't get spamming notifications await bot.send_read_acknowledge(conv.chat_id) await args.edit(f"`Sticker kanged successfully!`\ \nPack can be found [here](t.me/addstickers/{packname})", parse_mode='md')