Skip to content

Commit 0ce1638

Browse files
committed
Fixed naming for sanitization
1 parent 59e16d4 commit 0ce1638

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bot.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ def format_channel_name(self, author, exclude_channel=None, force_null=False):
17521752
guild = self.modmail_guild
17531753

17541754
if force_null:
1755-
return "null"
1755+
return ensure_unique_channel_name("null", guild, excluse_channel)
17561756
else:
17571757
if self.config["use_random_channel_name"]:
17581758
to_hash = self.token.split(".")[-1] + str(author.id)
@@ -1772,11 +1772,11 @@ def format_channel_name(self, author, exclude_channel=None, force_null=False):
17721772
else:
17731773
name = author.name.lower()
17741774

1775-
name = "".join(l for l in name if l not in string.punctuation and l.isprintable()) or "null"
1775+
sanitized_name = "".join(l for l in name if l not in string.punctuation and l.isprintable()) or "null"
17761776
if author.discriminator != "0":
1777-
name += f"-{author.discriminator}"
1777+
sanitized_name += f"-{author.discriminator}"
17781778

1779-
return ensure_unique_channel_name(name, guild, excluse_channel)
1779+
return ensure_unique_channel_name(sanitized_name, guild, excluse_channel)
17801780

17811781
def ensure_unique_channel_name(self, name, guild, exclude_channel) -> str:
17821782
counter = 1

0 commit comments

Comments
 (0)