Skip to content

Commit

Permalink
✨ add time to indicate event create time
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Oct 31, 2023
1 parent c978f18 commit a4f6dbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nonebot/adapters/feishu/event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from copy import deepcopy
from datetime import datetime
from typing_extensions import override
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional

Expand Down Expand Up @@ -104,6 +105,10 @@ def get_session_id(self) -> str:
def is_tome(self) -> bool:
return False

@property
def time(self) -> datetime:
return datetime.utcfromtimestamp(int(self.header.create_time) / 1000)


class MessageEvent(Event):
__event__ = "im.message.receive_v1"
Expand Down

0 comments on commit a4f6dbf

Please sign in to comment.