LoginUrl class pyrogram.types.LoginUrl ads via CarbonDesign and Development tips in your…
- User
LoginUrl class pyrogram.types.LoginUrl ads via CarbonDesign and Development tips in your inbox. Every weekday. ads via Carbon Represents a parameter of the inline keyboard button used to automatically authorize a user.
Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
Parameters: url (str) – An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data https://core.telegram.org/widgets/login#receiving-authorization-data.
NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
forward_text (str, optional) – New text of the button in forwarded messages.
bot_username (str, optional) – Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot’s username will be assumed. The url’s domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
request_write_access (str, optional) – Pass True to request the permission for your bot to send messages to the user.
button_id (int) – Button identifier.
InlineKeyboardButton class pyrogram.types.InlineKeyboardButton ads via CarbonBuild your website for just $3.88/mth. More value and performance with Namecheap. ads via Carbon One button of an inline keyboard.
You must use exactly one of the optional fields.
Parameters: text (str) – Label text on the button.
callback_data (str | bytes, optional) – Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
url (str, optional) – HTTP url to be opened when button is pressed.
web_app (WebAppInfo, optional) – Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answer_web_app_query(). Available only in private chats between a user and the bot.
login_url (LoginUrl, optional) – An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
user_id (int, optional) – User id, for links to the user profile.
switch_inline_query (str, optional) – If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
- Assistant
کلاس
LoginUrlدر کتابخانه Pyrogram، نمایانگر پارامترهای یک دکمه در کیبورد اینلاین است که برای مجوزدهی خودکار کاربر طراحی شده است. این کلاس به عنوان یک جایگزین عالی برای ویجت ورود تلگرام عمل میکند، به طوری که کاربر فقط با کلیک کردن روی یک دکمه و تأیید ورود خود، میتواند به سرعت وارد شود.ویژگیها و پارامترهای اصلی این کلاس به شرح زیر است:
-
url (str): URLی است که هنگام فشار دادن دکمه با دادههای مجوزدهی کاربر به رشته پرس و جو اضافه میشود. اگر کاربر از ارائه اطلاعات مجوزدهی خود امتناع کند، URL اصلی بدون دادههای کاربر باز میشود.
-
forward_text (str, optional): متنی جدید برای دکمه در پیامهای فوروارد شده.
-
bot_username (str, optional): نام کاربری رباتی که برای مجوزدهی کاربر استفاده خواهد شد. اگر مشخص نشده باشد، نام کاربری ربات جاری فرض میشود.
-
request_write_access (bool, optional): با قرار دادن مقدار True، اجازه ارسال پیامها به کاربر از طرف ربات درخواست میشود.
-
button_id (int): شناساگر دکمه.
به طور کلی،
LoginUrlبه توسعهدهندگان این امکان را میدهد که با ایجاد یک دکمه ورود در باتهای تلگرام، فرایند ورود کاربر را تسهیل کنند و تجربه کاربری بهتری فراهم آورند. -
- User
یعنی چی بیشتر توضیح بده من ی پروژه drf جنگو دارم و میخوام از طریق کتابخونه pyrogram با این وب سرور ارتباط بگیرم و داده رد و بدل کنم بدیهی است که من با دکمه های شیشه ای قراره داده ریکوست get, post, put, delete ارسال کنم این loginurl چطوری میتونه در هر ریکوست من احراز هویت کاربر رو تایید کنه و ممن براساس اینکه کدوم کاربر دکمه شیشه ای رو فشار داده بفهمم باید چ داده هایی براش ارسال کنم یا ازش داده دریافت کنم؟
- Assistant
- User
خب چطوری یک داده میتونم سمت سرور از طریق تلگرام ارسال کنم و با loginurl هم احراز هویت بشم
- Assistant