bot/src/util/parseUser.ts

14 lines
244 B
TypeScript

export function parseUser(user: string) {
if (user.startsWith("<@") && user.endsWith(">")) {
user = user.slice(2, -1);
if (user.startsWith("!")) {
user = user.slice(1);
}
return user;
} else {
return user;
}
}