Add Speedtest cog #28

Open
cswimr wants to merge 17 commits from speedtest into main
Showing only changes of commit eb41c1a72b - Show all commits

View file

@ -62,7 +62,7 @@ class Speedtest(commands.Cog):
return return
embed = discord.Embed(title="Speedtest Results", url=r["result"]["url"], color=await ctx.embed_color()) embed = discord.Embed(title="Speedtest Results", url=r["result"]["url"], color=await ctx.embed_color())
embed.add_field(name="Bandwidth", value=f"{r['download']['bandwidth'] / 1_000_000:.2f} Mbps down, {r['upload']['bandwidth'] / 1_000_000:.2f} Mbps up") embed.add_field(name="Bandwidth", value=f"{r['download']['bandwidth'] / 1_000_000:.2f} Mbps down, {r['upload']['bandwidth'] / 1_000_000:.2f} Mbps up")
embed.add_field(name="Ping", value=f"Base: {round(r['ping']['latency'])} ms \nDownload: {round(r['download']['latency']['igm'])} ms \nUpload: {round(r['upload']['latency']['igm'])} ms") embed.add_field(name="Ping", value=f"Base: {round(r['ping']['latency'])} ms \nDownload: {round(r['download']['latency']['iqm'])} ms \nUpload: {round(r['upload']['latency']['iqm'])} ms")
embed.set_image(url=r["result"]["image"] + ".png") embed.set_image(url=r["result"]["image"] + ".png")
await msg.edit(embed=embed) await msg.edit(embed=embed)
else: else: