fix(speedtest): just show the speedtest.net image
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 27s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 39s

This commit is contained in:
Seaswimmer 2024-05-25 18:17:00 -04:00
parent 94b692a705
commit 9103d64fbc
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -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}")