async def addrss(client, message): pablo = await edit_or_reply(message, "`Processing....`") lenk = get_text(message) if not lenk: await pablo.edit("Invalid Command Syntax, Please Check Help Menu To Know More!") return try: rss_d = feedparser.parse(lenk) rss_d.entries[0].title except: await pablo.edit( "ERROR: The link does not seem to be a RSS feed or is not supported" ) return lol = is_get_chat_rss(message.chat.id, lenk) if lol: await pablo.edit("This Link Already Added") return content = "" content += f"**{rss_d.entries[0].title}**" content += f"\n\n{rss_d.entries[0].link}" try: content += f"\n{rss_d.entries[0].description}" except: pass await client.send_message(message.chat.id, content) add_rss(message.chat.id, lenk, rss_d.entries[0].link) await pablo.edit("Successfully Added Link To RSS Watch")
async def logogen(client, message): pablo = await client.send_message(message.chat.id, "`Creating The Logo.....`") Godzilla = get_text(message) if not Godzilla: await pablo.edit( "Invalid Command Syntax, Please Check Help Menu To Know More!") return lmao = Godzilla.split(":", 1) try: typeo = lmao[1] except BaseException: typeo = "name" await pablo.edit( "Give name and type for logo Idiot. like `/logogen AuraXRobot:Robot`" ) name = lmao[0] mainne(name, typeo) pate = "*****@*****.**" await client.send_photo(message.chat.id, pate) try: os.remove(pate) except: pass await pablo.delete()
async def delrss(client, message): pablo = await edit_or_reply(message, "`Processing....`") lenk = get_text(message) if not lenk: await pablo.edit("Invalid Command Syntax, Please Check Help Menu To Know More!") return lol = is_get_chat_rss(message.chat.id, lenk) if not lol: await pablo.edit("This Link Was Never Added") return del_rss(message.chat.id, lenk) await pablo.edit(f"Successfully Removed `{lenk}` From Chat RSS")
async def tagall(client, message): await message.reply("`Processing.....`") sh = get_text(message) if not sh: sh = "Hi!" mentions = "" async for member in client.iter_chat_members(message.chat.id): mentions += member.user.mention + " " n = 4096 kk = [mentions[i:i + n] for i in range(0, len(mentions), n)] for i in kk: j = f"<b>{sh}</b> \n{i}" await client.send_message(message.chat.id, j, parse_mode="html")
async def paste(client, message): pablo = await edit_or_reply(message, "`Please Wait.....`") tex_t = get_text(message) message_s = tex_t if not tex_t: if not message.reply_to_message: await pablo.edit("`Reply To File / Give Me Text To Paste!`") return if not message.reply_to_message.text: file = await message.reply_to_message.download() m_list = open(file, "r").read() message_s = m_list print(message_s) os.remove(file) elif message.reply_to_message.text: message_s = message.reply_to_message.text key = (requests.post("https://nekobin.com/api/documents", json={ "content": message_s }).json().get("result").get("key")) url = f"https://nekobin.com/{key}" raw = f"https://nekobin.com/raw/{key}" reply_text = f"Pasted Text To [NekoBin]({url}) And For Raw [Click Here]({raw})" await pablo.edit(reply_text)
async def ytmusic(client, message: Message): urlissed = get_text(message) if not urlissed: await client.send_message( message.chat.id, "Invalid Command Syntax, Please Check Help Menu To Know More!", ) return global dl_limit if dl_limit >= 4: await message.reply_text( "AuraXRobot's server busy due to too many downloads, try again after sometime." ) return pablo = await client.send_message( message.chat.id, f"`Getting {urlissed} From Youtube Servers. Please Wait.`") search = SearchVideos(f"{urlissed}", offset=1, mode="dict", max_results=1) mi = search.result() mio = mi["search_result"] mo = mio[0]["link"] mio[0]["duration"] thum = mio[0]["title"] fridayz = mio[0]["id"] thums = mio[0]["channel"] kekme = f"https://img.youtube.com/vi/{fridayz}/hqdefault.jpg" dl_limit = dl_limit + 1 await asyncio.sleep(0.6) sedlyf = wget.download(kekme) opts = { "format": "bestaudio", "addmetadata": True, "key": "FFmpegMetadata", "writethumbnail": True, "prefer_ffmpeg": True, "geo_bypass": True, "nocheckcertificate": True, "postprocessors": [{ "key": "FFmpegExtractAudio", "preferredcodec": "mp3", "preferredquality": "720", }], "outtmpl": "%(id)s.mp3", "quiet": True, "logtostderr": False, } try: with YoutubeDL(opts) as ytdl: ytdl_data = ytdl.extract_info(mo, download=True) except Exception as e: await pablo.edit(f"**Failed To Download** \n**Error :** `{str(e)}`") dl_limit = dl_limit - 1 return c_time = time.time() capy = f"**Song Name :** `{thum}` \n**Requested For :** `{urlissed}` \n**Channel :** `{thums}` \n**Link :** `{mo}`" file_stark = f"{ytdl_data['id']}.mp3" await client.send_audio( message.chat.id, audio=open(file_stark, "rb"), duration=int(ytdl_data["duration"]), title=str(ytdl_data["title"]), performer=str(ytdl_data["uploader"]), thumb=sedlyf, caption=capy, progress=progress, progress_args=( pablo, c_time, f"`Uploading {urlissed} Song From YouTube Music!`", file_stark, ), ) dl_limit = dl_limit - 1 await pablo.delete() for files in (sedlyf, file_stark): if files and os.path.exists(files): os.remove(files)
async def ytmusic(client, message: Message): global is_downloading if is_downloading: await message.reply_text( "Another download is in progress, try again after sometime.") return global dl_limit if dl_limit >= 4: await message.reply_text( "AuraXRobot s server busy due to too many downloads, try again after sometime." ) return urlissed = get_text(message) pablo = await client.send_message( message.chat.id, f"`Getting {urlissed} From Youtube Servers. Please Wait.`") if not urlissed: await pablo.edit( "Invalid Command Syntax, Please Check Help Menu To Know More!") return search = SearchVideos(f"{urlissed}", offset=1, mode="dict", max_results=1) mi = search.result() mio = mi["search_result"] mo = mio[0]["link"] thum = mio[0]["title"] fridayz = mio[0]["id"] thums = mio[0]["channel"] kekme = f"https://img.youtube.com/vi/{fridayz}/hqdefault.jpg" await asyncio.sleep(0.6) url = mo sedlyf = wget.download(kekme) opts = { "format": "best", "addmetadata": True, "key": "FFmpegMetadata", "prefer_ffmpeg": True, "geo_bypass": True, "nocheckcertificate": True, "postprocessors": [{ "key": "FFmpegVideoConvertor", "preferedformat": "mp4" }], "outtmpl": "%(id)s.mp4", "logtostderr": False, "quiet": True, } try: is_downloading = True with youtube_dl.YoutubeDL(opts) as ytdl: infoo = ytdl.extract_info(url, False) duration = round(infoo["duration"] / 60) if duration > 8: await pablo.edit( f"❌ Videos longer than 8 minute(s) aren t allowed, the provided video is {duration} minute(s)" ) is_downloading = False return ytdl_data = ytdl.extract_info(url, download=True) except Exception: # await pablo.edit(event, f"**Failed To Download** \n**Error :** `{str(e)}`") is_downloading = False return c_time = time.time() file_stark = f"{ytdl_data['id']}.mp4" capy = f"**Video Name ➠** `{thum}` \n**Requested For :** `{urlissed}` \n**Channel :** `{thums}` \n**Link :** `{mo}`" await client.send_video( message.chat.id, video=open(file_stark, "rb"), duration=int(ytdl_data["duration"]), file_name=str(ytdl_data["title"]), thumb=sedlyf, caption=capy, supports_streaming=True, progress=progress, progress_args=( pablo, c_time, f"`Uploading {urlissed} Song From YouTube Music!`", file_stark, ), ) await pablo.delete() is_downloading = False for files in (sedlyf, file_stark): if files and os.path.exists(files): os.remove(files)
async def send(client, message): args = get_text(message) await client.send_message(message.chat.id, text=args)