Skip to content

Commit 4d9d86f

Browse files
committed
Use Discord timestamp
1 parent a6d8b70 commit 4d9d86f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

forward/forward.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@ async def tblock(self, ctx, user: discord.Member, time: Optional[str] = "5d"):
280280
duration = str_to_timedelta(duration=time).get("duration")
281281
duration = duration if type(duration) is timedelta else str_to_timedelta(duration="5d").get("duration")
282282
blocked[userid] = (datetime.now(timezone.utc) + duration).timestamp() # until
283-
await ctx.maybe_send_embed("Blocked <@{id}> from sending messages to the bot until {until}.".format(id=userid, until=datetime.fromtimestamp(blocked[userid])))
283+
await ctx.maybe_send_embed("Blocked <@{id}> from sending messages to the bot until <t:{until}>.".format(id=userid, until=int(blocked[userid])))
284284
else:
285-
await ctx.maybe_send_embed("This user is already blocked until {}.".format(datetime.fromtimestamp(blocked[userid])))
285+
await ctx.maybe_send_embed("This user is already blocked until <t:{}>.".format(int(blocked[userid])))
286286

287287
@commands.command()
288288
@commands.guild_only()
@@ -307,7 +307,7 @@ async def tcheckblock(self, ctx, user: discord.Member):
307307
async with self.config.blocked() as blocked:
308308
userid = str(user.id)
309309
if userid in blocked:
310-
await ctx.maybe_send_embed("User <@{id}> is blocked until {until}.".format(id=userid, until=datetime.fromtimestamp(blocked[userid])))
310+
await ctx.maybe_send_embed("User <@{id}> is blocked until <t:{until}>.".format(id=userid, until=int(blocked[userid])))
311311
else:
312312
await ctx.maybe_send_embed("This user is not blocked.")
313313

0 commit comments

Comments
 (0)