Horje
how to make a latency command discord.py Code Example
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
how to make a latency command discord.py
@bot.command(name="ping", pass_context=True, aliases=["latency", "latence"])
async def ping(ctx):
    
    embed = discord.Embed(title="__**Latence**__", colour=discord.Color.dark_gold(), timestamp=ctx.message.created_at)
    embed.add_field(name="Latence du bot :", value=f"`{round(bot.latency * 1000)} ms`")

    await ctx.send(embed=embed)
    
    """
    Text in french
    """




Python

Related
add column names to dataframe pandas Code Example add column names to dataframe pandas Code Example
pandas add header to existing dataframe Code Example pandas add header to existing dataframe Code Example
python loop every month datetime Code Example python loop every month datetime Code Example
latency discord.py Code Example latency discord.py Code Example
text to ascii art python Code Example text to ascii art python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7