我如何计算我的电报机器人单击 /启动的用户?
我需要一个Python代码来检查电报机器人的单击 /启动多少用户。我该如何使机器人回复? 用户:23 我需要知道单击 /开始的人数
I need a Python code to check how many users clicked /start on my telegram bot. How can I make the bot reply like this?
users: 23
I need to know the number of people that have clicked /start
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一种非常基本的方法:
#1
usercount
”。/start
命令的响应的代码部分。1
中的数据库中的值增加值。 (代码可能取决于不同的数据库类型)#2
此值代表NO。时间
/start
命令已执行。但是,单个用户可以无限期地执行/start
命令。因此,为了使其特定于用户并防止单个用户被算作多个用户,您可以扩展代码功能。一种方法是:
USERCOUNT
by1
代码>现在
您已经设置了系统,最后一步是为了告诉您有多少用户已执行
> /start
命令。USERCOUNT
注意,这只是一种基本方法,可能存在漏洞,并且可能有更好的方法。
Here is a very basic approach:
#1
usercount
"./start
command.1
. (Code may vary depending on different database types)#2
This value would represent the no. of times the
/start
command has been executed. However, a single user may simply execute/start
command indefinitely.So, to make it user-specific and prevent a single user from being counted as multiple users, you can extend the code functionality. One way to do that is:
usercount
by1
#3
Now that you have set up the system, the last step is making a new command for telling you how many users have executed
/start
command.usercount
Note that this is only a basic approach, there might be loopholes, and there might be better ones out there.