async def log(event): chat = event.chat_id if not is_admin(event, event.sender_id): return await event.reply("You need to be an admin to do this") args = event.pattern_match.group(1) if not args: fedowner = sql.get_user_owner_fed_full(event.sender_id) if not fedowner: return await event.reply( "Only fed creators can set a fed log - but you don't have a federation!" ) for f in fedowner: args = "{}".format(f["fed_id"]) name = f["fed"]["fname"] else: if len(args) < 8: return await event.reply("This isn't a valid FedID format!") getfed = sql.search_fed_by_id(args) name = getfed["fname"] if not getfed: return await event.reply( "This FedID does not refer to an existing federation.") setlog = sql.set_fed_log(args, chat) await event.reply( f"This has been set as the fed log for {name} - all fed related actions will be logged here." )
async def _(event): if event.is_private: return if event.is_group: if not is_admin(event, event.sender_id): await event.reply("You need to be an admin to do this.") return if not await can_change_info(message=event): return chat = event.chat_id args = event.pattern_match.group(1) if args: if args == "on" or args == "yes": sql.set_chat_setting(chat, True) await event.reply("Users will now be able to report messages.") elif args == "off" or args == "no": sql.set_chat_setting(chat, False) await event.reply( "Users will no longer be able to report via @admin or /report." ) else: await event.reply( "Your input was not recognised as one of: yes/no/on/off") return else: await event.reply( f"Reports are currently {sql.chat_should_report(chat)} in this chat. Users can use the /report command, or mention @admin, to tag all admins.\n\nTo change this setting, try this command again, with one of the following args: yes/no/on/off", parse_mode="markdown", )
async def echo(event): if event.fwd_from: return if event.sender_id == OWNER_ID: pass elif sudo(event.sender_id): pass elif is_admin(event, event.sender_id): pass else: return ok = event.pattern_match.group(1) if ok: if event.reply_to_msg_id: previous_message = await event.get_reply_message() if previous_message.sender_id == OWNER_ID: return await event.reply("F**k you too!") try: await event.delete() except: pass await tbot.send_message(event.chat_id, ok, reply_to=previous_message.id) else: try: await event.delete() except: pass await tbot.send_message(event.chat_id, ok) elif event.reply_to_msg_id: previous_message = await event.get_reply_message() try: await event.delete() except Exception: pass k = await tbot.send_message( event.chat_id, previous_message ) else: await tbot.send_message(event.chat_id, f"{event.sender.first_name} Chithiya. Echo krnekeliye kuch ni deta🤨")