async def sedlyfsir(event): pro = await bot.get_me() boy = pro.id if not event.sender_id in DEVS: if not event.sender_id == boy: return msgtobroadcast = event.text.split(" ", maxsplit=1)[1] userstobc = get_all_users() error_count = 0 sent_count = 0 hmmok = "" if msgtobroadcast == None: await event.reply("`Wait. What? Broadcast None?`") return elif msgtobroadcast == "": await event.reply("`Give Something to Broadcast ☺️`") return for uzers in userstobc: try: sent_count += 1 await xbot.send_message(int(uzers.chat_id), msgtobroadcast) await asyncio.sleep(0.2) except: error_count += 1 await xbot.send_message( event.chat_id, f"**Broadcast Completed in {sent_count} Group/Users..**\n__➥ Error :__ {error_count}\n__➥ Total Number Was :__ {len(userstobc)}", )
async def _(event): pro = await bot.get_me() boy = pro.id if not event.sender_id == boy: return await event.reply("you cant access this") all = get_all_users() await event.reply( f"**Stats Of Your Bot**\nTotal Users In Bot => {len(all)}")
async def users(event): pro = await bot.get_me() boy = pro.id wrong = "sorry you cant access this" if not event.sender_id == boy: return await event.answer(wrong, alert=False) if event.is_group or event.is_private: await event.delete() total_users = get_all_users() users_list = "Lɪsᴛ Oғ Tᴏᴛᴀʟ Usᴇʀs Iɴ Bᴏᴛ. \n\n" for ultrappl in total_users: users_list += ("=> {} \n").format(int(ultrappl.chat_id)) with io.BytesIO(str.encode(users_list)) as tedt_file: tedt_file.name = "userlist.txt" await xbot.send_file( event.chat_id, tedt_file, force_document=True, caption="**Tᴏᴛᴀʟ Usᴇʀs Iɴ Yᴏᴜʀ Bᴏᴛ.**", allow_cache=False, ) else: pass