Add Speedtest cog #28
1 changed files with 1 additions and 8 deletions
|
@ -62,17 +62,10 @@ class Speedtest(commands.Cog):
|
||||||
await msg.edit(embed=discord.Embed(description=f"An error occurred! {speedtest}", color=discord.Colour.red()))
|
await msg.edit(embed=discord.Embed(description=f"An error occurred! {speedtest}", color=discord.Colour.red()))
|
||||||
return
|
return
|
||||||
embed = discord.Embed(title="Speedtest Results", url=speedtest.result.url, color=await ctx.embed_color())
|
embed = discord.Embed(title="Speedtest Results", url=speedtest.result.url, color=await ctx.embed_color())
|
||||||
embed.add_field(name="Bandwidth", value=f"{speedtest.download.mbps:,.2f} Mbps down, {speedtest.upload.mbps:,.2f} Mbps up")
|
|
||||||
embed.add_field(name="Ping", value=f"Base: {round(speedtest.ping.latency)} ms \nDownload: {round(speedtest.download.latency.iqm)} ms \nUpload: {round(speedtest.upload.latency.iqm)} ms")
|
|
||||||
embed.set_image(url=speedtest.result.image)
|
embed.set_image(url=speedtest.result.image)
|
||||||
await msg.edit(embed=embed)
|
await msg.edit(embed=embed)
|
||||||
else:
|
else:
|
||||||
if not isinstance(speedtest, sp):
|
if not isinstance(speedtest, sp):
|
||||||
await msg.edit(content=f"An error occurred! \n`{speedtest}`")
|
await msg.edit(content=f"An error occurred! \n`{speedtest}`")
|
||||||
return
|
return
|
||||||
await msg.edit(content=f"**Speedtest Results**\n"
|
await msg.edit(content=f"**[Result]({speedtest.result.url})**")
|
||||||
f"**Bandwidth**: {speedtest.download.mbps:,.2f} Mbps down ({speedtest.download.bandwidth}), {speedtest.download.mbps:,.2f} Mbps up\n"
|
|
||||||
f"**Ping**: Base: {round(speedtest.ping.latency)} ms\n"
|
|
||||||
f"Download: {round(speedtest.download.latency.iqm)} ms\n"
|
|
||||||
f"Upload: {round(speedtest.upload.latency.iqm)} ms\n"
|
|
||||||
f"**Image**: {speedtest.result.image}")
|
|
||||||
|
|
Loading…
Reference in a new issue