pineafan | 3276721 | 2022-03-14 21:27:39 +0000 | [diff] [blame] | 1 | async 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 | |
| 15 | export default convertCurlyBracketString; |