async def starky(event): if event.sender_id == Config.OWNER_ID: msg = await event.get_reply_message() msg.id event.raw_text user_id, reply_message_id = his_userid(msg.id) if not is_he_added(user_id): await event.reply("Not Even Blacklisted.") elif is_he_added(user_id): removenibba(user_id) await event.reply("DisBlacklisted This Dumb Person") await chatbot.send_message( user_id, "Congo! You Have Been Unblacklisted By My Master.") await chatbot.send_message( Config.DUMB_CHAT, f"DisBlacklisted User \nUser ID : {user_id}")
async def starkisnoob(event): if event.sender_id == Config.OWNER_ID: msg = await event.get_reply_message() if msg is None: await event.reply("Reply To User") user_id, reply_message_id = his_userid(msg.id) if is_he_added(user_id): await event.reply("Already Blacklisted.") elif not is_he_added(user_id): add_nibba_in_db(user_id) await event.reply("Blacklisted This Dumb Person") await chatbot.send_message( user_id, "You Have Been Blacklisted And You Can't Message My Master Now." ) await chatbot.send_message(Config.DUMB_CHAT, f"Blacklisted New user \nUser ID : {user_id}")
async def all_messages_catcher(event): if is_he_added(event.sender_id): return if event.raw_text.startswith("/"): pass elif event.sender_id == Config.OWNER_ID: return else: sender = await event.get_sender() chat_id = event.chat_id sed = await event.forward_to(Config.OWNER_ID) add_me_in_db(sed.id, event.sender_id, event.id)
async def all_messages_catcher(event): if is_he_added(event.sender_id): return if event.sender_id == Config.OWNER_ID: return if event.raw_text.startswith("/"): return if Config.JMT_ENABLE: try: result = await chatbot( functions.channels.GetParticipantRequest( channel=Config.JMTC_ID, user_id=event.sender_id)) except telethon.errors.rpcerrorlist.UserNotParticipantError: await event.reply( f"**To Message My Master, Please Join My Channel. :)**", buttons=[Button.url("Join Channel", Config.JMTC_LINK)]) return await event.get_sender() sed = await event.forward_to(Config.OWNER_ID) add_me_in_db(sed.id, event.sender_id, event.id)