Skip to content

Commit

Permalink
[WarnSystem] Fix a bug with manual logs
Browse files Browse the repository at this point in the history
The bot would fail at creating an entry if the ban is a hackban

Resolves #163
  • Loading branch information
laggron42 committed Jun 7, 2021
1 parent f4969e5 commit d6eefdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion warnsystem/warnsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __init__(self, bot):

self.task: asyncio.Task

__version__ = "1.3.18"
__version__ = "1.3.19"
__author__ = ["retke (El Laggron)"]

# helpers
Expand Down Expand Up @@ -1418,6 +1418,8 @@ async def on_member_ban(self, guild: discord.Guild, member: discord.Member):
if entry.user.id != guild.me.id:
# Don't create modlog entires for the bot's own bans, cogs do this.
mod, reason, date = entry.user, entry.reason, entry.created_at
if isinstance(member, discord.User):
member = UnavailableMember(self.bot, guild._state, member.id)
try:
await self.api.warn(
guild,
Expand Down

0 comments on commit d6eefdc

Please sign in to comment.