stemount / cloutbot

A useful Discord bot that lets you validate people who help, contribute and thank with a star.
5 stars 2 forks source link

The regex for `username++` and `username--` needs to be figured out #1

Open stemount opened 3 years ago

stemount commented 3 years ago

Basic bot functionality:

[Discord Users account username]

stemount++ `@stemount`++ [Server Nickname] `@Steve || KindnessRocks™`++ (we would need to reverse engineer what is allowed in Discord nicks to make a good match, or even might just simply be possible to flatten mentions in messages straight to USer IDs. To do add to this, we might need to decide the regex is PRCE, JS, POSIX etc... - [ ] `@183982332342832932++` Discord ID? - [ ] `@stemount++` Discord/Slack/remote user - [ ] `stemount++` same as above stripping out a mention
ThatCopy commented 3 years ago
/\+\+\s*$/

Should work

JackBocresion commented 3 years ago

we are currently able to get the mention from the message, and this does apply to nicknames. we could possibly try recognizing names from just random text, like "rep stemount ++" => "did you mean: @stemount?"

JackBocresion commented 3 years ago

right now, I am splitting the string into arguments with explode(), and then checking that there is only one a mention in the message, and making sure it starts with "rep".

ThatCopy commented 3 years ago

I used a .includes("++") in my TS implementation