Skip to content

Commit

Permalink
[WarnSystem] Bug fixes (version 1.3.13)
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit e95b96b
Author: retke <laggron42@gmail.com>
Date:   Sun Feb 28 21:19:23 2021 +0100

    Fix UTC inconsistency

commit a96b4b3
Author: retke <laggron42@gmail.com>
Date:   Sun Feb 28 17:53:13 2021 +0100

    Handle empty time with automod warn show

    Resolves #146
  • Loading branch information
laggron42 committed Feb 28, 2021
1 parent c804348 commit 493377f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion warnsystem/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ def is_autowarn_valid(warn):
# we increase this value until reaching the given limit
time = autowarn["time"]
if time:
until = datetime.now() - timedelta(seconds=time)
until = datetime.utcnow() - timedelta(seconds=time)
autowarns[i]["until"] = until
del time
found_warnings = {} # we fill this list with the valid autowarns, there can be more than 1
Expand Down
2 changes: 1 addition & 1 deletion warnsystem/automod.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ async def automod_warn_show(self, ctx: commands.Context, index: int):
autowarn["warn"]["reason"],
autowarn["level"],
autowarn["automod_only"],
timedelta(seconds=autowarn["time"]),
timedelta(seconds=autowarn["time"]) if autowarn["time"] else None,
timedelta(seconds=duration) if duration else None,
)
await ctx.send(embed=embed)
Expand Down

0 comments on commit 493377f

Please sign in to comment.