Answers for "discord.py client.latency"

2

how to make a latency command discord.py

@client.command()
async def ping(ctx):
    before = time.monotonic()
    message = await ctx.send("Pong!")
    ping = (time.monotonic() - before) * 1000
    await message.edit(content=f"Pong!  `{int(ping)}ms`")
    
    #for discord.py rewrite
Posted by: Guest on February-03-2021
0

how to make a latency command in discord py

@client.command()
async def Ping(ctx):
    await ctx.send(f"PONG! latency is {round(client.latency *1000)} ms!")
Posted by: Guest on January-04-2022

Python Answers by Framework

Browse Popular Code Answers by Language