fix incorrect timestamp parse string

This commit is contained in:
Corban-Lee Jones 2024-12-12 16:44:29 +00:00
parent d929dc875d
commit d02794709c

View File

@ -129,7 +129,7 @@ class PlayersCog(commands.Cog):
player, created = await Player.get_or_create(username=re_match.group("username"))
await player.open_session(
timestamp=datetime.strptime(re_match.group("timestamp"), "%m-%d-%y %H:%M:%S.%f"),
timestamp=datetime.strptime(re_match.group("timestamp"), "%d-%m-%y %H:%M:%S.%f"),
coord_x=re_match.group("x"),
coord_y=re_match.group("y"),
coord_z=re_match.group("z")
@ -154,7 +154,7 @@ class PlayersCog(commands.Cog):
embed.title = "Player Has Connected"
embed.colour = Colour.brand_green()
# await channel.send(embed=embed)
await channel.send(embed=embed)
async def process_disconnected_player(self, line: str, alert: bool = False):
"""
@ -169,7 +169,7 @@ class PlayersCog(commands.Cog):
player, created = await Player.get_or_create(username=re_match.group("username"))
await player.close_session(
timestamp=datetime.strptime(re_match.group("timestamp"), "%m-%d-%y %H:%M:%S.%f"),
timestamp=datetime.strptime(re_match.group("timestamp"), "%d-%m-%y %H:%M:%S.%f"),
coord_x=re_match.group("x"),
coord_y=re_match.group("y"),
coord_z=re_match.group("z")
@ -188,7 +188,7 @@ class PlayersCog(commands.Cog):
embed.title = "Player Has Disconnected"
embed.colour = Colour.brand_red()
# await channel.send(embed=embed)
await channel.send(embed=embed)
async def setup(bot: commands.Bot):