Skip to content

Commit f668fbc

Browse files
committed
[Commands] Only allow alphanumeric mail names
1 parent c1e175f commit f668fbc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tux/cogs/admin/mail.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ def __init__(self, bot: commands.Bot):
3838
async def register(
3939
self, interaction: discord.Interaction, member: discord.Member, username: str
4040
) -> None:
41+
if not username.isalnum():
42+
await interaction.response.send_message(
43+
"Username must be alphanumeric and contain no spaces.", ephemeral=True
44+
)
45+
return
46+
4147
if interaction.guild:
4248
mailbox_data = self.default_options.copy()
4349
mailbox_data["local_part"] = username

0 commit comments

Comments
 (0)