Add member name conflict warning. Closes #10.
This commit is contained in:
@@ -10,9 +10,11 @@ from pluralkit.member import Member
|
||||
|
||||
logger = logging.getLogger("pluralkit.utils")
|
||||
|
||||
|
||||
def escape(s):
|
||||
return s.replace("`", "\\`")
|
||||
|
||||
|
||||
def bounds_check_member_name(new_name, system_tag):
|
||||
if len(new_name) > 32:
|
||||
return "Name cannot be longer than 32 characters."
|
||||
@@ -21,6 +23,7 @@ def bounds_check_member_name(new_name, system_tag):
|
||||
if len("{} {}".format(new_name, system_tag)) > 32:
|
||||
return "This name, combined with the system tag ({}), would exceed the maximum length of 32 characters. Please reduce the length of the tag, or use a shorter name.".format(system_tag)
|
||||
|
||||
|
||||
async def parse_mention(client: discord.Client, mention: str) -> Optional[discord.User]:
|
||||
# First try matching mention format
|
||||
match = re.fullmatch("<@!?(\\d+)>", mention)
|
||||
|
||||
Reference in New Issue
Block a user