Ask coding questions

← Back to all posts
How to do a Ping command?
ntomoon (0)

How do you do a ping command?
Ex.
Me: #ping
Bot: 145ms

My language is Python btw...

Comments
hotnewtop
Wumi4 (531)

You can use the os module:

import os
os.system("ping -c 1 <the_website.here>")

Also, you mean ping to your bot's server or what? I don't use Discord.