async def dapprove(event): if event.fwd_from: return if event.is_private: replied_user = await event.client(GetFullUserRequest(await event.get_input_chat())) firstname = replied_user.user.first_name if pmpermit_sql.is_approved(event.chat_id): pmpermit_sql.disapprove(event.chat_id) await event.edit( "Disapproved User [{}](tg://user?id={})".format(firstname, event.chat_id) ) await asyncio.sleep(3) await event.delete() elif not pmpermit_sql.is_approved(event.chat_id): led = await event.edit("`This User Is Not Even Approved To Disapprove !`") await asyncio.sleep(3) await led.delete() elif event.is_group: reply_s = await event.get_reply_message() if not reply_s: await event.edit('`Reply To User To DisApprove Him !`') return if pmpermit_sql.is_approved(reply_s.sender_id): replied_user = await event.client(GetFullUserRequest(reply_s.sender_id)) firstname = replied_user.user.first_name pmpermit_sql.disapprove(reply_s.sender_id) await event.edit( "Disapproved User [{}](tg://user?id={})".format(firstname, reply_s.sender_id) ) await asyncio.sleep(3) await event.delete() elif not pmpermit_sql.is_approved(reply_s.sender_id): await event.edit('`User Even Not Approved !`') await event.delete()
async def approve_p_m(event): if event.fwd_from: return if event.is_private: replied_user = await event.client( GetFullUserRequest(await event.get_input_chat())) firstname = replied_user.user.first_name if pmpermit_sql.is_approved(event.chat_id): pmpermit_sql.disapprove(event.chat_id) await event.edit("Blocked [{}](tg://user?id={})".format( firstname, event.chat_id)) await event.client(functions.contacts.BlockRequest(event.chat_id)) elif event.is_group: reply_s = await event.get_reply_message() if not reply_s: await event.edit('`Reply To User To Block Him !`') return replied_user = await event.client(GetFullUserRequest(reply_s.sender_id) ) firstname = replied_user.user.first_name if pmpermit_sql.is_approved(event.chat_id): pmpermit_sql.disapprove(event.chat_id) await event.edit("Blocked [{}](tg://user?id={})".format( firstname, reply_s.sender_id)) await event.client(functions.contacts.BlockRequest(reply_s.sender_id)) await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return replied_user = await event.client(GetFullUserRequest(event.chat_id)) firstname = replied_user.user.first_name if event.is_private: if pmpermit_sql.is_approved(event.chat_id): pmpermit_sql.disapprove(event.chat_id) await event.edit("Blocked [{}](tg://user?id={})".format( firstname, event.chat_id)) await borg(functions.contacts.BlockRequest(event.chat_id))
async def approve_p_m(event): if event.fwd_from: return replied_user = await event.client(GetFullUserRequest(event.chat_id)) firstname = replied_user.user.first_name chat = await event.get_chat() if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit( "Disapproved User [{}](tg://user?id={})".format( firstname, chat.id)) await event.delete()
async def dapprove(event): if event.fwd_from: return replied_user = await borg(GetFullUserRequest(event.chat_id)) firstname = replied_user.user.first_name if event.is_private: if pmpermit_sql.is_approved(event.chat_id): pmpermit_sql.disapprove(event.chat_id) await event.edit( "Disapproved User [{}](tg://user?id={})".format( firstname, event.chat_id)) await asyncio.sleep(3) await event.delete() elif not pmpermit_sql.is_approved(event.chat_id): led = await event.edit( "`This User Is Not Even Approved To Disapprove !`") await asyncio.sleep(3) await led.delete()
async def dapprove(event): if event.fwd_from: return if event.is_private: replied_user = await event.client( GetFullUserRequest(await event.get_input_chat())) firstname = replied_user.user.first_name if pmpermit_sql.is_approved(event.chat_id): pmpermit_sql.disapprove(event.chat_id) await event.edit( "Proteksi Pm aktif untuk [{}](tg://user?id={})".format( firstname, event.chat_id)) await asyncio.sleep(3) await event.delete() elif not pmpermit_sql.is_approved(event.chat_id): led = await event.edit("`Pengguna ini belum di izinkan`") await asyncio.sleep(3) await led.delete() elif event.is_group: reply_s = await event.get_reply_message() if not reply_s: await event.edit( '`Balas pesan pengguna Untuk Mengaktifkan Proteksi PM`') return if pmpermit_sql.is_approved(reply_s.sender_id): replied_user = await event.client( GetFullUserRequest(reply_s.sender_id)) firstname = replied_user.user.first_name pmpermit_sql.disapprove(reply_s.sender_id) await event.edit( "Proteksi PM sudah aktif untuk [{}](tg://user?id={})". format(firstname, reply_s.sender_id)) await asyncio.sleep(3) await event.delete() elif not pmpermit_sql.is_approved(reply_s.sender_id): await event.edit('`Pengguna Tidak Di Izinkan`') await event.delete()