xxxxxxxxxx
@client.command()
async def Ping(ctx):
await ctx.send(f"PONG! latency is {round(client.latency *1000)} ms!")
xxxxxxxxxx
@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
xxxxxxxxxx
@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
"""