From 9f78563eea0341be45756a6676444ab1cdba7af9 Mon Sep 17 00:00:00 2001 From: Hipstercat Date: Tue, 1 Sep 2020 16:17:56 +0200 Subject: [PATCH] float to int --- cogs/wynncraft/wynncraftcog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/wynncraft/wynncraftcog.py b/cogs/wynncraft/wynncraftcog.py index 19300f3..0900601 100644 --- a/cogs/wynncraft/wynncraftcog.py +++ b/cogs/wynncraft/wynncraftcog.py @@ -1,5 +1,6 @@ import asyncio import itertools +import math from redbot.core import commands from redbot.core import Config, checks @@ -304,7 +305,7 @@ class WynncraftCog(commands.Cog): for almost_online_player in almost_online_players: last_join_dt_utc = datetime.strptime(almost_online_player["data"][0]["meta"]["lastJoin"], "%Y-%m-%dT%H:%M:%S.%fZ") last_join_dt_local = utc_to_local(last_join_dt_utc) - mins = (datetime.now(last_join_dt_local.tzinfo) - last_join_dt_local).total_seconds() // 60 + mins = math.ceil((datetime.now(last_join_dt_local.tzinfo) - last_join_dt_local).total_seconds() // 60) s = ":grey_question: **%s** était connecté il y a %s minutes" % (almost_online_player["data"][0]["username"], mins) full_text += s + "\n" if not online_players and not almost_online_players: