Fix Case's modified_at attr and its format in message content (#5317)

* Fix modified_at field to properly format.

* let's just fix the type hints

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Kowlin 2021-09-14 02:42:20 +02:00 committed by GitHub
parent eeed082542
commit 89e3a78ead
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,7 +283,7 @@ class Case:
.. note::
This attribute will be of type `int`
if the Discord user can no longer be found.
modified_at: Optional[int]
modified_at: Optional[float]
The UNIX time of the last change to the case.
`None` if the case was never edited.
message: Optional[discord.Message]
@ -310,7 +310,7 @@ class Case:
until: Optional[int] = None,
channel: Optional[Union[discord.abc.GuildChannel, int]] = None,
amended_by: Optional[Union[discord.Object, discord.abc.User, int]] = None,
modified_at: Optional[int] = None,
modified_at: Optional[float] = None,
message: Optional[discord.Message] = None,
last_known_username: Optional[str] = None,
):
@ -454,7 +454,7 @@ class Case:
last_modified = None
if self.modified_at:
last_modified = f"<t:{self.modified_at}>"
last_modified = f"<t:{int(self.modified_at)}>"
if isinstance(self.user, int):
if self.user == 0xDE1: