我查看了很多地方,但找不到使用 ping (延迟)命令的方法discord.py
,像这样:
@client.command(pass_context=True)
async def pong(ctx):
# Somehow find 'pingtime'
await client.say(pingtime)
实际上此时您应该使用重写discord.py的分支 https://github.com/Rapptz/discord.py/tree/rewrite
这将是我使用命令扩展的解决方案。
@bot.command()
async def ping(ctx):
await ctx.send('Pong! {0}'.format(round(bot.latency, 1)))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)