Add game
This commit is contained in:
parent
d36e98ad0b
commit
c071b286af
23 changed files with 713 additions and 11 deletions
|
|
@ -80,6 +80,18 @@ const getUserName = (user: IUser): string => {
|
|||
return username;
|
||||
};
|
||||
|
||||
const getUserNameById = (userId: string): string => {
|
||||
const userPattern = /@[a-zA-Z0-9]*/;
|
||||
const match = userId.match(userPattern)?.at(0);
|
||||
if (!match) {
|
||||
return "";
|
||||
}
|
||||
|
||||
let username = match.replaceAll("@", "");
|
||||
username = username.charAt(0).toUpperCase() + username.slice(1);
|
||||
return username;
|
||||
};
|
||||
|
||||
const getUserFromMention = (mention: string | undefined): IUser | undefined => {
|
||||
if (!mention) {
|
||||
return undefined;
|
||||
|
|
@ -139,6 +151,7 @@ export {
|
|||
checkRoles,
|
||||
getLevel,
|
||||
getUserName,
|
||||
getUserNameById,
|
||||
getUserFromMention,
|
||||
changePersonality,
|
||||
log,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue