gurkult / gurkbot

Our community bot, used for running the server.
MIT License
18 stars 16 forks source link

Gurkancount and Isgurkan #2

Closed Shivansh-007 closed 3 years ago

Shivansh-007 commented 3 years ago

is_gurkan check and gurkancount

Gurkancount checks how many gurkans there are in the server. Isgurkan checks if a certain member is a gurkan.

Who is a gurkan?

Gurkan is person who has gurk or gurkan in his name, it can be in any case

Would you like to implement this yourself?

v1nam commented 3 years ago

I would like to work on this on my own

gustavwilliam commented 3 years ago

@saiTama-max Feel free to give it a shot -- I'll assign you.

I already have a polished version of the gurkancount command that was supposed to go on SeasonalBot. We could use that as the base here. https://github.com/python-discord/sir-lancebot/blob/901cb7afbd3bd485152c2c32c52a100a1a023609/bot/exts/evergreen/gurkan.py

Furthermore, we want to either fuzzy match or use a regex for checking if someone is gurkan. I'd love to hear about your ideas on what the best approach would be. We have a members list in the server that you could have a look at if you want some inspiration.

v1nam commented 3 years ago

so the idea i currently have is to use fuzzywuzzy for the isgurkan command and regex for gurkancount, reason being is that in fuzzywuzzy you get a ratio/percentage on how much the substring matches, this could be used to tell how much purity the person has to the gurkult, but if we use this in the gurkancount command, i dont see any sense in using it there anyway, since we just show the count, and it would be just unnecessary code to check if the percentage is greater than 30 or something so it is a valid gurkan, we could use regex here which would be cleaner

gustavwilliam commented 3 years ago

In both cases, I would like it to use the same function to give a yes or no answer for if the person is gurkan. Doesn’t matter to me if it uses purely regex, fuzzy matching or a combination.

I also like the idea of adding a “purity” indicator for the isgurkan command. This is how I would imagine the embed for isgurkan:

❌ Not gurkan <- title

@user is 15% gurkan. <- description (Red embed)

🥒 Gurkan

@usergurkan is 83% gurkan. (Green embed)

v1nam commented 3 years ago

oh so a common function for both? then i think i could use fuzzywuzzy then

gustavwilliam commented 3 years ago

Yep. At least for getting the Boolean that says either True or False. That’s what we use to count the amount of gurkans, check isgurkan and auto-assign gurkan roles. We need to be consistent in what names are considered gurkan and what names aren’t.