fix(ping): quick fix for ping result
This commit is contained in:
parent
4d479f6516
commit
68ca0cb2fc
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ class Basics(commands.Cog):
|
||||||
ping_res = str(subprocess.Popen(["/bin/ping", "-c1", "discordapp.com"],
|
ping_res = str(subprocess.Popen(["/bin/ping", "-c1", "discordapp.com"],
|
||||||
stdout=subprocess.PIPE).stdout.read())
|
stdout=subprocess.PIPE).stdout.read())
|
||||||
formated_res = [item for item in ping_res.split() if 'time=' in item]
|
formated_res = [item for item in ping_res.split() if 'time=' in item]
|
||||||
result = str(formated_res[0])[5:]
|
result = self.bot.latency * 1000 # str(formated_res[0])[5:]
|
||||||
|
|
||||||
if float(result) >= 200:
|
if float(result) >= 200:
|
||||||
em = discord.Embed(title="Ping : " + str(result) + "ms",
|
em = discord.Embed(title="Ping : " + str(result) + "ms",
|
||||||
|
|
Loading…
Reference in a new issue