我到过很多地方,但找不到使用discord.py
进行ping(延迟)命令的方法,如下所示:
@client.command(pass_context=True)
async def pong(ctx):
# Somehow find 'pingtime'
await client.say(pingtime)
最佳答案
确实在这一点上,您应该使用rewrite branch of discord.py
这将是我使用命令扩展名的解决方案。
@bot.command()
async def ping(ctx):
await ctx.send('Pong! {0}'.format(round(bot.latency, 1)))
关于python - Discord.py中的延迟命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46307035/