Added escaping in system member list
This commit is contained in:
parent
e25f24a25b
commit
5bb0b3f489
@ -10,6 +10,8 @@ import humanize
|
|||||||
from pluralkit import db
|
from pluralkit import db
|
||||||
from pluralkit.bot import client, logger
|
from pluralkit.bot import client, logger
|
||||||
|
|
||||||
|
def escape(s):
|
||||||
|
return s.replace("`", "\`")
|
||||||
|
|
||||||
def generate_hid() -> str:
|
def generate_hid() -> str:
|
||||||
return "".join(random.choices(string.ascii_lowercase, k=5))
|
return "".join(random.choices(string.ascii_lowercase, k=5))
|
||||||
@ -224,7 +226,7 @@ async def generate_system_info_card(conn, system: asyncpg.Record) -> discord.Emb
|
|||||||
# Get names of all members
|
# Get names of all members
|
||||||
member_texts = []
|
member_texts = []
|
||||||
for member in await db.get_all_members(conn, system_id=system["id"]):
|
for member in await db.get_all_members(conn, system_id=system["id"]):
|
||||||
member_texts.append("{} (`{}`)".format(member["name"], member["hid"]))
|
member_texts.append("{} (`{}`)".format(escape(member["name"]), member["hid"]))
|
||||||
|
|
||||||
if len(member_texts) > 0:
|
if len(member_texts) > 0:
|
||||||
card.add_field(name="Members", value="\n".join(
|
card.add_field(name="Members", value="\n".join(
|
||||||
|
Loading…
Reference in New Issue
Block a user