wow-token-app-bot

An interactions.py Discord bot for getting and alerting on the WoW Token Price
git clone https://git.emily.sh/wowtoken-app/wow-token-app-bot.git
Log | Files | Refs | README | LICENSE

commit 3fffcf86c9fe8a8db5bf1bb72031afc79e623c26
parent 84561948da11abab9b6de0670d95e7cbee2b7513
Author: Emily Doherty <git@emily.sh>
Date:   Mon, 16 Dec 2024 14:45:36 -0800

Format timestamps to be in local time zone provided by Discord

Diffstat:
Mtoken_bot/tracker.py | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/token_bot/tracker.py b/token_bot/tracker.py @@ -317,7 +317,7 @@ class Tracker(Extension): return ( f"Last Price Value for {region}: {format(region_history.last_price_datum[1], ",")}\n" - f"Last Update Time: {region_history.last_price_datum[0].strftime('%Y-%m-%d %H:%M:%S UTC')}\n" + f"Last Update Time: <t:{int(region_history.last_price_datum[0].timestamp())}:F> local time\n" f"Last Price Movement: {price_movement_str}" ) @@ -494,7 +494,7 @@ class Tracker(Extension): if trigger.last_trigger is not None: alert_str = ( f"Last Alerting Price Value: {format(trigger.last_alerting[1], ",")}\n" - f"Last Alerting Time: {trigger.last_alerting[0].strftime('%Y-%m-%d %H:%M:%S UTC')}\n" + f"Last Alerting Time: <t:{int(trigger.last_alerting[0].timestamp())}:F> local time\n" f"[Link to this Chart]({self._render_token_url(alert)})\n" ) if user is not None and user.user_id == 265678699435655169: