randydev commited on
Commit
26ba6c8
·
verified ·
1 Parent(s): f658713

Update akn/utils/expired_bot.py

Browse files
Files changed (1) hide show
  1. akn/utils/expired_bot.py +4 -1
akn/utils/expired_bot.py CHANGED
@@ -40,8 +40,11 @@ async def watch_do_time(user_id, client, assistant):
40
  if isinstance(expired_on, str):
41
  expired_on = dt.strptime(expired_on, "%d-%m-%Y")
42
 
43
- LOGS.info(f"Expiration date for user {user_id}: {expired_on}")
 
44
 
 
 
45
  if now >= expired_on:
46
  await client.log_out()
47
  await assistant.send_message(
 
40
  if isinstance(expired_on, str):
41
  expired_on = dt.strptime(expired_on, "%d-%m-%Y")
42
 
43
+ if expired_on.tzinfo is None:
44
+ expired_on = timezone("Asia/Jakarta").localize(expired_on)
45
 
46
+ LOGS.info(f"Expiration date for user {user_id}: {expired_on.strftime('%d-%m-%Y')}")
47
+
48
  if now >= expired_on:
49
  await client.log_out()
50
  await assistant.send_message(