Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

bot ping 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
Source by vcokltfre.dev #
 
PREVIOUS NEXT
Tagged: #bot #ping
ADD COMMENT
Topic
Name
4+8 =