From a56322570c6c41d908fcdf7e6d94a525cf90ffe4 Mon Sep 17 00:00:00 2001 From: gip <98342753+giplgwm@users.noreply.github.com> Date: Thu, 4 Apr 2024 03:32:15 -0400 Subject: [PATCH] Added discord timestamps (#6264) Co-authored-by: palmtree5 <3577255+palmtree5@users.noreply.github.com> --- redbot/cogs/streams/streamtypes.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/redbot/cogs/streams/streamtypes.py b/redbot/cogs/streams/streamtypes.py index c95a05b5b6e..5c7290eb4be 100644 --- a/redbot/cogs/streams/streamtypes.py +++ b/redbot/cogs/streams/streamtypes.py @@ -221,17 +221,16 @@ async def make_embed(self, data): if vid_data["liveStreamingDetails"].get("scheduledStartTime", None) is not None: if "actualStartTime" not in vid_data["liveStreamingDetails"]: start_time = parse_time(vid_data["liveStreamingDetails"]["scheduledStartTime"]) + start_time_unix = time.mktime(start_time.timetuple()) start_in = start_time - datetime.now(timezone.utc) if start_in.total_seconds() > 0: - embed.description = _("This stream will start in {time}").format( - time=humanize_timedelta( - timedelta=timedelta(minutes=start_in.total_seconds() // 60) - ) # getting rid of seconds + embed.description = _("This stream will start ").format( + time=int(start_time_unix) ) else: - embed.description = _( - "This stream was scheduled for {min} minutes ago" - ).format(min=round((start_in.total_seconds() * -1) // 60)) + embed.description = _("This stream was scheduled for ").format( + time=int(start_time_unix) + ) embed.timestamp = start_time is_schedule = True else: