blob: 093e52239d3c7bd9a56ba38bdf7aa57b6273d3d3 [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
15export default convertCurlyBracketString;