在discord.py文档中,我们有一个方法client.latency
,它返回Bot的延迟
但实际上我是在问我们是否可以检查其他用户的延迟,比如
User: sd!ping @Mention
Bot: XXms is the Ping of @Mention
这是默认的ping命令,这将返回Bot的延迟时间
@client.command()
async def ping(ctx):
await ctx.send(f'{round(client.latency * 1000)}ms')
有没有像Mention.latency
这样的方法可以返回提到的用户的延迟
If it is Not Possible till now, please Let me know... Thanks in Advance !
Discord此时只允许您查看自己的延迟。这项功能不太可能实现,因为即使是普通用户也无法在语音通道中看到其他用户的延迟
你可以尝试使用一个网站,并从中获取它们的延迟,然后将其发送到bot以供使用。为此,您可能需要使用Flask/Django或express.js
相关问题 更多 >
编程相关推荐