bot/src/util/parseUser.ts

14 lines
244 B
TypeScript
Raw Normal View History

2020-01-25 17:02:34 +00:00
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;
}
}