Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ every time
* `/prepembed` now allows for exporting/import embeds.
* Direct message logs are now more cleanly formatted and use relative dates.
* Users are now sent a direct message about why their message was deleted after editing it to include a censored term.
* Staff can now change a user's nickname or kick the user from a innapropriate username report.
* Staff can now change a user's nickname or kick the user from a inappropriate username report.
* Edited message logs now include a link to jump to a message.
* Deleted message logs of non-cached messages now contain an explanation for why more data is not available in the log.
* Censor cog for handling all message censoring.
Expand Down
10 changes: 5 additions & 5 deletions src/discord/censor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class Censor(commands.Cog):
"""
Responsible for censoring innapropriate words' and emojis in user content.
Responsible for censoring inappropriate words' and emojis in user content.
"""

def __init__(self, bot: PiBot):
Expand Down Expand Up @@ -223,7 +223,7 @@ async def on_message_edit(self, before: discord.Message, after: discord.Message)
await after.author.send(
"You recently edited a message, but it **contained a censored "
"word**! Therefore, I unfortunately had to delete it. In the "
"future, please do not edit innapropriate words into your "
"future, please do not edit inappropriate words into your "
"messages, and they will not be deleted.",
)

Expand All @@ -240,7 +240,7 @@ async def on_message_edit(self, before: discord.Message, after: discord.Message)

@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
# Check to see if user's name is innapropriate
# Check to see if user's name is inappropriate
name = member.name
if await self.censor_needed(name):
# If name contains a censored link
Expand All @@ -252,13 +252,13 @@ async def on_member_join(self, member: discord.Member):
async def on_member_update(self, _, after):
"""
When a member updates their presence on the Discord server, check to see
if their name contains an innapropriate term, and if so, open a report.
if their name contains an inappropriate term, and if so, open a report.

Args:
after (discord.Member): The member who changed their name, after they've
changed it.
"""
# Notify staff if the user updated their name to include an innapropriate name
# Notify staff if the user updated their name to include an inappropriate name
if after.nick is None:
return # No need to check if user does not have a new nickname set

Expand Down
34 changes: 17 additions & 17 deletions src/discord/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class IgnoreButton(discord.ui.Button):
the report database to be updated.
"""

report_view: InnapropriateUsername | InvitationalRequest
report_view: InappropriateUsername | InvitationalRequest

def __init__(self, view: InnapropriateUsername | InvitationalRequest):
def __init__(self, view: InappropriateUsername | InvitationalRequest):
self.report_view = view
super().__init__(
style=discord.ButtonStyle.gray,
Expand All @@ -47,7 +47,7 @@ async def callback(self, interaction: discord.Interaction):
interaction.guild.text_channels,
name="closed-reports",
)
if isinstance(self.report_view, InnapropriateUsername):
if isinstance(self.report_view, InappropriateUsername):
await closed_reports.send(
f"**Report was ignored** by {interaction.user.mention} - {self.report_view.member.mention} had the "
f"inappropriate username `{self.report_view.offending_username}`, but the report was ignored. ",
Expand All @@ -67,9 +67,9 @@ class CompletedButton(discord.ui.Button):
A button to mark a report as completed.
"""

report_view: InnapropriateUsername | InvitationalRequest
report_view: InappropriateUsername | InvitationalRequest

def __init__(self, view: InnapropriateUsername | InvitationalRequest):
def __init__(self, view: InappropriateUsername | InvitationalRequest):
self.report_view = view
super().__init__(
style=discord.ButtonStyle.green,
Expand Down Expand Up @@ -101,9 +101,9 @@ class ChangeInappropriateUsername(discord.ui.Button):
and the report database to be updated.
"""

report_view: InnapropriateUsername
report_view: InappropriateUsername

def __init__(self, view: InnapropriateUsername):
def __init__(self, view: InappropriateUsername):
self.report_view = view
super().__init__(
style=discord.ButtonStyle.green,
Expand All @@ -127,15 +127,15 @@ async def callback(self, interaction: discord.Interaction):
)
if member_still_here:
await closed_reports.send(
f"**Member's username was changed** by {interaction.user.mention} - {self.report_view.member.mention} had the innapropriate username `{self.report_view.offending_username}`, and their username was changed to `boomilever`.",
f"**Member's username was changed** by {interaction.user.mention} - {self.report_view.member.mention} had the inappropriate username `{self.report_view.offending_username}`, and their username was changed to `boomilever`.",
)

# Change the user's username
await self.report_view.member.edit(nick="boomilever")

else:
await closed_reports.send(
f"**Member's username was attempted to be changed** by {interaction.user.mention} - {self.report_view.member.mention} had the innapropriate username `{self.report_view.offending_username}`, and their username was attempted to be changed to `boomilever`, however, the user had left the server.",
f"**Member's username was attempted to be changed** by {interaction.user.mention} - {self.report_view.member.mention} had the inappropriate username `{self.report_view.offending_username}`, and their username was attempted to be changed to `boomilever`, however, the user had left the server.",
)

# Update the report database
Expand All @@ -147,9 +147,9 @@ class KickUserButton(discord.ui.Button):
Discord button which allows a staff member to promptly kick a user.
"""

report_view: InnapropriateUsername
report_view: InappropriateUsername

def __init__(self, view: InnapropriateUsername):
def __init__(self, view: InappropriateUsername):
self.report_view = view
super().__init__(
style=discord.ButtonStyle.red,
Expand All @@ -173,15 +173,15 @@ async def callback(self, interaction: discord.Interaction):
)
if member_still_here:
await closed_reports.send(
f"**Member was kicked** by {interaction.user.mention} - {self.report_view.member.mention} had the innapropriate username `{self.report_view.offending_username}`, and the user was kicked from the server.",
f"**Member was kicked** by {interaction.user.mention} - {self.report_view.member.mention} had the inappropriate username `{self.report_view.offending_username}`, and the user was kicked from the server.",
)

# Kick the user
await self.report_view.member.kick()

else:
await closed_reports.send(
f"**Attempted to kick member* by {interaction.user.mention} - {self.report_view.member.mention} had the innapropriate username `{self.report_view.offending_username}` and a kick was attempted on the user, however, the user had left the server.",
f"**Attempted to kick member* by {interaction.user.mention} - {self.report_view.member.mention} had the inappropriate username `{self.report_view.offending_username}` and a kick was attempted on the user, however, the user had left the server.",
)

# Update the report database
Expand Down Expand Up @@ -265,9 +265,9 @@ async def callback(self, interaction: discord.Interaction):
await update_invitational_list(self.report_view.bot)


class InnapropriateUsername(discord.ui.View):
class InappropriateUsername(discord.ui.View):
"""
Discord view representing a report on a user with an innapropriate username.
Discord view representing a report on a user with an inappropriate username.
"""

member: discord.Member
Expand Down Expand Up @@ -367,7 +367,7 @@ async def create_inappropriate_username_report(
offending_username: str,
):
"""
Creates a report that a user has an innapropriate username.
Creates a report that a user has an inappropriate username.

Args:
member: The member with the inappropriate username.
Expand Down Expand Up @@ -396,7 +396,7 @@ async def create_inappropriate_username_report(
)
await reports_channel.send(
embed=embed,
view=InnapropriateUsername(member, 123, offending_username),
view=InappropriateUsername(member, 123, offending_username),
)

async def create_cron_task_report(self, task: dict) -> None:
Expand Down
Loading