77from pyrogram import Client , filters , errors , types
88from config import Rkn_Bots
99import asyncio , re , time , sys
10- from .database import *
10+ from .database import total_user , getid , delete , addCap , updateCap , insert
1111from pyrogram .errors import FloodWait
1212
1313@Client .on_message (filters .private & filters .user (Rkn_Bots .ADMIN ) & filters .command (["rknusers" ]))
@@ -20,27 +20,27 @@ async def all_db_users_here(client,message):
2020async def broadcast (bot , message ):
2121 if (message .reply_to_message ):
2222 rkn = await message .reply_text ("Geting All ids from database..\n Please wait" )
23- ids = await getid ()
23+ all_users = await getid ()
2424 tot = await total_user ()
2525 success = 0
2626 failed = 0
2727 deactivated = 0
2828 blocked = 0
2929 await rkn .edit (f"ʙʀᴏᴀᴅᴄᴀsᴛɪɴɢ..." )
30- for id in ids :
30+ async for user in all_users :
3131 try :
3232 time .sleep (1 )
33- await message .reply_to_message .copy (id )
33+ await message .reply_to_message .copy (user [ '_id' ] )
3434 success += 1
3535 except errors .InputUserDeactivated :
3636 deactivated += 1
37- await delete ({"_id" : id })
37+ await delete ({"_id" : user [ '_id' ] })
3838 except errors .UserIsBlocked :
3939 blocked += 1
40- await delete ({"_id" : id })
40+ await delete ({"_id" : user [ '_id' ] })
4141 except Exception as e :
4242 failed += 1
43- await delete ({"_id" : bot_id })
43+ await delete ({"_id" : user [ '_id' ] })
4444 pass
4545 try :
4646 await rkn .edit (f"<u>ʙʀᴏᴀᴅᴄᴀsᴛ ᴘʀᴏᴄᴇssɪɴɢ</u>\n \n • ᴛᴏᴛᴀʟ ᴜsᴇʀs: { tot } \n • sᴜᴄᴄᴇssғᴜʟ: { success } \n • ʙʟᴏᴄᴋᴇᴅ ᴜsᴇʀs: { blocked } \n • ᴅᴇʟᴇᴛᴇᴅ ᴀᴄᴄᴏᴜɴᴛs: { deactivated } \n • ᴜɴsᴜᴄᴄᴇssғᴜʟ: { failed } " )
0 commit comments