def remove_chat(update: Update, context: CallbackContext): msg = update.effective_message chat = update.effective_chat user = update.effective_user is_chat = sql.is_chat(chat.id) if not is_chat: msg.reply_text("AI isn't enabled here in the first place!") return "" sql.rem_chat(chat.id) msg.reply_text("AI disabled successfully!") message = (f"<b>{html.escape(chat.title)}:</b>\n" f"#AI_DISABLED\n" f"<b>Admin:</b> {mention_html(user.id, user.first_name)}\n") return message
async def _(event): if event.is_group: if not await can_change_info(message=event): return else: return chat = event.chat send = await event.get_sender() user = await tbot.get_entity(send) is_chat = sql.is_chat(chat.id) if not is_chat: await event.reply("AI isn't enabled here in the first place!") return "" sql.rem_chat(chat.id) await event.reply("AI disabled successfully!")