Code: Select all
async def theirs(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.text == "Others User ID":
await update.message.reply_text("OK. Send me a forwarded message from them.")
context.user_data['await'] = True
return
if context.user_data.get('await'):
user = update.message.forward_from
if user:
await update.message.reply_text(f"Theirs User ID: `{user.id}`", parse_mode="MarkdownV2")
else:
await update.message.reply_text(
"The account was hidden, use the 'Username To User Id' option instead."
)
context.user_data['await'] = False
Mobile version