improved communication system
This commit is contained in:
@@ -61,3 +61,13 @@ export const applyUsername = async (user) => {
|
||||
body: { nickname: discordUsername, discordId: user.discord.id }
|
||||
})
|
||||
}
|
||||
|
||||
export const getUsernameWithTeam = async (user) => {
|
||||
const teamsColl = db.collection('teams')
|
||||
const team = user.team ? await teamsColl.findOne({ _id: new ObjectId(user.team.id) }): undefined;
|
||||
|
||||
const username = user.team ? user.username + ` [<color:${team.color}>${team.name}</color>]` : user.username;
|
||||
const usernameWithoutStyle = user.team ? user.username + ` [${team.name}]` : user.username;
|
||||
|
||||
return { username: username, usernameWithoutStyle: usernameWithoutStyle, team: team }
|
||||
}
|
||||
|
Reference in New Issue
Block a user