mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 13:43:06 -04:00
escape markdown in usernames
This commit is contained in:
parent
5bf19dc0de
commit
e8e0ff7379
3 changed files with 6 additions and 3 deletions
|
@ -52,7 +52,8 @@ module.exports = {
|
|||
if (u.bot) botTag = ""
|
||||
if (u.hasFlag(UserFlags.VERIFIED_BOT)) botTag = ""
|
||||
|
||||
let usernameDisplay = u.username
|
||||
// We escape underscores to prevent markdown issues
|
||||
let usernameDisplay = u.username.replace(/_/g,'\\_');
|
||||
if (u.discriminator && u.discriminator !== "0") usernameDisplay += `#${u.discriminator}`
|
||||
|
||||
usernameDisplay = `**@${usernameDisplay}**${botTag} ${highlight(`(${u.id})`)}`
|
||||
|
|
|
@ -34,7 +34,8 @@ module.exports = {
|
|||
if (u.bot) botTag = ""
|
||||
if (u.hasFlag(UserFlags.VERIFIED_BOT)) botTag = ""
|
||||
|
||||
let usernameDisplay = u.name
|
||||
// We escape underscores to prevent markdown issues
|
||||
let usernameDisplay = u.name.replace(/_/g,'\\_');
|
||||
if (u.discriminator && u.discriminator !== "0") usernameDisplay += `#${u.discriminator}`
|
||||
|
||||
usernameDisplay = `**@${usernameDisplay}**${botTag} ${highlight(`(${u.id})`)}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue