Fix miliseconds
authorOrakaro <nhatminh_179@hotmail.com>
Thu, 21 Nov 2019 10:24:46 +0000 (19:24 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Thu, 21 Nov 2019 10:24:46 +0000 (19:24 +0900)
rainbowstream/draw.py
rainbowstream/rainbow.py

index 215bfb3..2fcdeb4 100644 (file)
@@ -487,8 +487,7 @@ def print_right_message(m):
         printNicely(screen_line)
     printNicely(dotline)
     # Format clock
-    date = parser.parse(m['created_at'])
-    date = arrow.get(date).to('local').datetime
+    date = arrow.get(int(m['created_at'])/1000).to('local').datetime # Read Unixtime in miliseconds
     clock_format = '%Y/%m/%d %H:%M:%S'
     try:
         clock_format = c['FORMAT']['MESSAGE']['CLOCK_FORMAT']
index c42437b..822f3bb 100644 (file)
@@ -839,7 +839,7 @@ def inbox():
     messages = t.direct_messages.events.list()['events']
     messages = list(map(map_message, messages))
     inbox = list(filter(inboxFilter, messages))
-    sent = list(filter(inboxFilter, messages))
+    sent = list(filter(sentFilter, messages))
 
     d = {}
     uniq_inbox = list(set(