backtracking nowtimestamp method

This commit is contained in:
Mylloon 2021-06-03 12:33:43 +02:00
parent c296bb35a9
commit 81f865b102

View file

@ -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