diff options
author | 2021-08-05 16:32:44 -0700 | |
---|---|---|
committer | 2021-08-05 16:32:44 -0700 | |
commit | ad1fcfbdab5be55f16ab157bcf86927c7996ed07 (patch) | |
tree | ccb97f7e8d8b2733986214e5221f2447b42aa54a | |
parent | Time: rename time_since to format_relative (diff) |
Time: replace discord_timestamp calls with format_relative
Use the latter where the former was being called with the relative
format type.
-rw-r--r-- | bot/exts/info/information.py | 6 | ||||
-rw-r--r-- | bot/exts/moderation/defcon.py | 2 | ||||
-rw-r--r-- | bot/exts/utils/reminders.py | 2 | ||||
-rw-r--r-- | bot/utils/time.py | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index a83ce4d53..29a00ec5d 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -173,7 +173,7 @@ class Information(Cog): """Returns an embed full of server information.""" embed = Embed(colour=Colour.og_blurple(), title="Server Information") - created = time.discord_timestamp(ctx.guild.created_at, time.TimestampFormats.RELATIVE) + created = time.format_relative(ctx.guild.created_at) num_roles = len(ctx.guild.roles) - 1 # Exclude @everyone # Server Features are only useful in certain channels @@ -249,7 +249,7 @@ class Information(Cog): """Creates an embed containing information on the `user`.""" on_server = bool(await get_or_fetch_member(ctx.guild, user.id)) - created = time.discord_timestamp(user.created_at, time.TimestampFormats.RELATIVE) + created = time.format_relative(user.created_at) name = str(user) if on_server and user.nick: @@ -272,7 +272,7 @@ class Information(Cog): if on_server: if user.joined_at: - joined = time.discord_timestamp(user.joined_at, time.TimestampFormats.RELATIVE) + joined = time.format_relative(user.joined_at) else: joined = "Unable to get join date" diff --git a/bot/exts/moderation/defcon.py b/bot/exts/moderation/defcon.py index 048e0f990..263e8136e 100644 --- a/bot/exts/moderation/defcon.py +++ b/bot/exts/moderation/defcon.py @@ -148,7 +148,7 @@ class Defcon(Cog): @has_any_role(*MODERATION_ROLES) async def status(self, ctx: Context) -> None: """Check the current status of DEFCON mode.""" - expiry = time.discord_timestamp(self.expiry, time.TimestampFormats.RELATIVE) if self.expiry else "-" + expiry = time.format_relative(self.expiry) if self.expiry else "-" embed = Embed( colour=Colour.og_blurple(), title="DEFCON Status", description=f""" diff --git a/bot/exts/utils/reminders.py b/bot/exts/utils/reminders.py index dc7782727..bfa294809 100644 --- a/bot/exts/utils/reminders.py +++ b/bot/exts/utils/reminders.py @@ -348,7 +348,7 @@ class Reminders(Cog): for content, remind_at, id_, mentions in reminders: # Parse and humanize the time, make it pretty :D remind_datetime = isoparse(remind_at) - expiry = time.discord_timestamp(remind_datetime, time.TimestampFormats.RELATIVE) + expiry = time.format_relative(remind_datetime) mentions = ", ".join([ # Both Role and User objects have the `name` attribute diff --git a/bot/utils/time.py b/bot/utils/time.py index e6dcdee15..da56bcea8 100644 --- a/bot/utils/time.py +++ b/bot/utils/time.py @@ -228,4 +228,4 @@ def until_expiration( if since < now: return None - return discord_timestamp(since, TimestampFormats.RELATIVE) + return format_relative(since) |