fix(ping): quick fix for ping result

This commit is contained in:
Romain J 2020-04-07 16:00:39 +02:00
parent 4d479f6516
commit 68ca0cb2fc

View file

@ -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",