如何获得某人的年龄? Discord.py

问题描述 投票:0回答:1

为了防止新帐户使用某个命令,当他们键入消息时,如何获得用户帐户的使用期限(或创建日期)。>>


client.get_user(account_date)

if account_date < 14:
   print('Your account must be older than 14 days to use this command')
else:
   print('Your account can use this command')

感谢您的任何帮助。

为了防止新帐户使用某个命令,当他们键入消息时,如何获得用户帐户的使用期限(或创建日期)。 client.get_user(account_date)如果account_date <14:...

python discord.py
1个回答
0
投票

您可以从带有ctx.author的ctx或带有message.author的消息中获取一个User对象。

© www.soinside.com 2019 - 2024. All rights reserved.