blob: 02777511b96a89cdd64dd38d8cf9f76f51544d74 [file] [log] [blame]
pineafan32767212022-03-14 21:27:39 +00001async function convertCurlyBracketString(str, memberID, memberName, serverName, members): Promise<string> {
2 let memberCount = (await members.fetch()).size
3 let bots = (await members.fetch()).filter(m => m.user.bot).size
4 str = str
5 .replace("{@}", `<@${memberID}>`)
6 .replace("{server}", `${serverName}`)
7 .replace("{name}", `${memberName}`)
8 .replace("{count}", `${memberCount}`)
9 .replace("{count:bots}", `${bots}`)
10 .replace("{count:humans}", `${memberCount - bots}`);
11
12 return str
13}
14
pineafanc6158ab2022-06-17 16:34:07 +010015export default convertCurlyBracketString;