from app import app from pyrogram import filters from pyrogram.types import ReplyKeyboardMarkup, Message from pyrogram.client import Client from modules.utils import locale, logWrite from modules.database import col_users from modules import custom_filters # Start command ================================================================================================================ @app.on_message(custom_filters.enabled_applications & ~filters.scheduled & filters.private & filters.command(["start"], prefixes=["/"])) async def cmd_start(app: Client, msg: Message): user = col_users.find_one({"user": msg.from_user.id}) if user is None: col_users.insert_one({ "user": msg.from_user.id, "link": None, "label": "", "tg_name": msg.from_user.first_name, "tg_phone": msg.from_user.phone_number, "tg_locale": msg.from_user.language_code, "tg_username": msg.from_user.username }) logWrite(f"User {msg.from_user.id} started bot interaction") await msg.reply_text(locale("start", "message", locale=msg.from_user), reply_markup=ReplyKeyboardMarkup(locale("welcome", "keyboard", locale=msg.from_user), resize_keyboard=True)) # ==============================================================================================================================