From 81f865b10238d81af499210a8d7ffea533911fbc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 3 Jun 2021 12:33:43 +0200 Subject: [PATCH] backtracking nowtimestamp method --- src/cogs/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cogs/utils.py b/src/cogs/utils.py index 69b0a17..06bb025 100644 --- a/src/cogs/utils.py +++ b/src/cogs/utils.py @@ -39,7 +39,7 @@ class Utils(commands.Cog): if arg == 'help': return await ctx.send(embed = discord.Embed(color = discord.Colour.random(), description = ":hourglass: correspond au temps entre deux battements de cœurs\n\n:stopwatch: correspond au temps que met le client a calculer le ping\n\n:heartbeat: correspond au temps que met le client a réagir au messages")) else: - now = int(nowTimestamp()) + now = int(round(time.time() * 1000)) if fromSlash != True: ping = now - int(round(ctx.message.created_at.timestamp() * 1000)) else: @@ -52,7 +52,7 @@ class Utils(commands.Cog): await ctx.message.add_reaction(emoji = '✅') @cog_ext.cog_slash(name="ping", description = "Affiche mon ping.") async def __ping(self, ctx, arg = None): - ctx.slash_created_at = int(nowTimestamp()) + ctx.slash_created_at = int(datetime.now(timezone(self.customTimezone)).timestamp()) if arg == None: return await self._ping(ctx, True) else: @@ -226,7 +226,7 @@ class Utils(commands.Cog): await ctx.message.delete() embed = discord.Embed(description = text, color = discord.Colour.random()) embed.set_author(name = f"Mémo noté depuis {ctx.guild.name}", icon_url = ctx.author.avatar_url) - embed.set_footer(text = f'📝 le {nowTimestamp().strftime("%d/%m/%Y à %H:%M:%S")}') + embed.set_footer(text = f'📝 le {datetime.now(timezone(self.customTimezone)).strftime("%d/%m/%Y à %H:%M:%S")}') await ctx.author.send(embed = embed) return await ctx.send("Tu viens de recevoir ton mémo !", delete_after = 5) @_memo.error