From 7b471fcc6765d3763b57d7fe15a8f32081590d36 Mon Sep 17 00:00:00 2001 From: Anson Date: Mon, 4 Sep 2023 04:23:30 +0000 Subject: [PATCH] update status commmand --- common/MarketData.py | 4 ++-- common/cg_Crypto.py | 4 ++-- discord/bot.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/MarketData.py b/common/MarketData.py index cc32f6f..cdde21e 100644 --- a/common/MarketData.py +++ b/common/MarketData.py @@ -103,7 +103,7 @@ class MarketData: ) status.raise_for_status() except r.HTTPError: - return f"API returned an HTTP error code {status.status_code} in {status.elapsed.total_seconds()} Seconds." + return f"API returned an HTTP error code {status.status_code} in {status.elapsed.total_seconds()} seconds." except r.Timeout: return "API timed out before it was able to give status. This is likely due to a surge in usage or a complete outage." @@ -111,7 +111,7 @@ class MarketData: if statusJSON["status"] == "ok": return ( - f"CoinGecko API responded that it was OK with a {status.status_code} in {status.elapsed.total_seconds()} Seconds." + f"CoinGecko API responded that it was OK with a {status.status_code} in {status.elapsed.total_seconds()} seconds." ) else: return f"MarketData.app is currently reporting the following status: {statusJSON['status']}" diff --git a/common/cg_Crypto.py b/common/cg_Crypto.py index aa2f3af..dad38d0 100644 --- a/common/cg_Crypto.py +++ b/common/cg_Crypto.py @@ -77,10 +77,10 @@ class cg_Crypto: try: status.raise_for_status() return ( - f"CoinGecko API responded that it was OK with a {status.status_code} in {status.elapsed.total_seconds()} Seconds." + f"CoinGecko API responded that it was OK with a {status.status_code} in {status.elapsed.total_seconds()} seconds." ) except r.HTTPError: - return f"CoinGecko API returned an error code {status.status_code} in {status.elapsed.total_seconds()} Seconds." + return f"CoinGecko API returned an error code {status.status_code} in {status.elapsed.total_seconds()} seconds." def price_reply(self, coin: Coin) -> str: """Returns current market price or after hours if its available for a given coin symbol. diff --git a/discord/bot.py b/discord/bot.py index 8da2929..300f6a0 100644 --- a/discord/bot.py +++ b/discord/bot.py @@ -42,7 +42,7 @@ async def status(ctx: commands): message = "" try: message = "Contact MisterBiggs#0465 if you need help.\n" - message += s.status(f"Bot recieved your message in: {bot.latency*1000:.4f}ms") + "\n" + message += s.status(f"Bot recieved your message in: {bot.latency*10:.4f} seconds") + "\n" except Exception as ex: logging.critical(ex)