我可以通过Telegram Bot API通过用户ID获取电话号码吗? [英] Can I get a phone number by user id via Telegram Bot API?

查看:269
本文介绍了我可以通过Telegram Bot API通过用户ID获取电话号码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Telegram Bot API 向用户发送即时消息.我已经安装了

我需要用户的电话号码以在我们的系统中识别它们并将信息发送回给他们.

我的问题是我可以通过 telegramUserId 获取用户电话号码吗?

为了方便用户,我正在这样做.如果我可以获取用户电话号码,则不必向用户询问.

现在我的命令是这样的:

 债务9811201243 

我想要

 债务 

解决方案

bots 2.0可以签出bot api文档.

https://core.telegram.org/bots/2-0-intro#locations-and-numbers https://core.telegram.org/bots/api#keyboardbutton

I am using Telegram Bot API for sending instant messages to users. I have installed nuget package. This package is recommend by telegram developers.

I have created a telegram bot and successfully got access to it by using code. When I send messsage to bot, bot gets some info about sender.

I need the phone numbers of users to identify them in our system and send the information back to them.

My question is Can i get a user phone number by telegramUserId?

I'm doing it for user convenience. If I could to get a user phone number I should't have to ask for it from the user.

Now my command like this:

debt 9811201243

I want

debt

解决方案

It's possible with bots 2.0 check out bot api docs.

https://core.telegram.org/bots/2-0-intro#locations-and-numbers https://core.telegram.org/bots/api#keyboardbutton

这篇关于我可以通过Telegram Bot API通过用户ID获取电话号码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆