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

* Fix modified_at field to properly format.

* let's just fix the type hints

(cherry picked from commit 89e3a78ead)

Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Red-GitHubBot
2021-09-14 02:44:10 +02:00
committed by GitHub
parent 931eb312b2
commit 7bf8bd5a93

View File

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