Add Speedtest cog #28

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

View file

@ -58,7 +58,7 @@ class Speedtest(commands.Cog):
r = await self.run_speedtest()
if await ctx.embed_requested():
if isinstance(r, str):
await msg.edit(embed=discord.Embed(description=f"An error occurred! {r}", color=await discord.Colour.red()))
await msg.edit(embed=discord.Embed(description=f"An error occurred! {r}", color=discord.Colour.red()))
return
embed = discord.Embed(title="Speedtest Results", link=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")