Skip to content

Commit 9bd0427

Browse files
committed
Small formatting changes
1 parent aba5dbe commit 9bd0427

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

techsupport_bot/commands/modlog.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,18 @@ async def on_member_ban(
227227
)
228228

229229
entry = None
230-
async for entry in guild.audit_logs(limit=1, action=discord.AuditLogAction.ban):
230+
moderator = None
231+
async for entry in guild.audit_logs(
232+
limit=10, action=discord.AuditLogAction.ban
233+
):
231234
if entry.target.id == user.id:
232235
moderator = entry.user
236+
break
233237

234238
if not entry:
235239
return
236240

237-
if moderator.bot:
241+
if not moderator or moderator.bot:
238242
return
239243

240244
await log_ban(self.bot, user, moderator, guild, entry.reason)
@@ -255,15 +259,16 @@ async def on_member_unban(
255259
)
256260

257261
entry = None
262+
moderator = None
258263
async for entry in guild.audit_logs(
259-
limit=1, action=discord.AuditLogAction.unban
264+
limit=10, action=discord.AuditLogAction.unban
260265
):
261266
if entry.target.id == user.id:
262267
moderator = entry.user
263268
if not entry:
264269
return
265270

266-
if moderator.bot:
271+
if not moderator or moderator.bot:
267272
return
268273

269274
await log_unban(self.bot, user, moderator, guild, entry.reason)

techsupport_bot/commands/purge.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ async def purge_command(
5858

5959
if amount <= 0 or amount > config.extensions.purge.max_purge_amount.value:
6060
embed = auxiliary.prepare_deny_embed(
61-
message=f"Messages to purge must be between 0 and {config.extensions.purge.max_purge_amount.value}",
61+
message=(
62+
"Messages to purge must be between 0 "
63+
f"and {config.extensions.purge.max_purge_amount.value}"
64+
),
6265
)
6366
await interaction.response.send_message(embed=embed, ephemeral=True)
6467
return

techsupport_bot/commands/whois.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ async def setup(bot: bot.TechSupportBot) -> None:
2525

2626

2727
class Whois(cogs.BaseCog):
28+
"""The class for the /whois command"""
2829

2930
@app_commands.command(
3031
name="whois",

0 commit comments

Comments
 (0)