Nightbot accountage

Asked Mar 28, 2022·2 replies·Last activity 4 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

is there a command that does !accountage
${user} was created 1 year 5 months 27 days 1 hour ago.
but I don't just want it to be with the year and month I can't find any that work

2 replies

Hey @Sunlit Hamster!

You can adjust the output of the Twitch variable by using JavaScript and RegExp:

$(eval a='$(twitch $(touser) "{{createdLength}}")'.match(/\d+\syear(s)?\s\d+\smonth(s)?/g); `$(touser) was created ${a[0]} ago.`)
Polar Cat said:
```
$(eval a='$(twitch $(touser) "{{createdLength}}")'.match(/\d+\syear(s)?\s\d+\smonth(s)?/g); $(touser) was created ${a[0]} ago.)
```

it worked thank you so much I was stuck on it .