-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add in ability to give negative points. #13 #22
base: develop
Are you sure you want to change the base?
Conversation
Fixed leaderboard errors. Removed user tagging in leaderboards.
Fixing colors indexing error.
Added username validation. Fixed leaderboard truncation.
Fixed username validate.
Adding functions/methods to prevent the bot from sending PM's. Currently working for InMemoryStorage
Added PM Preferences methods to AzureStorage(storage) class
Added methods to RedisStorage to make use of the PM Preference setting. (left commented out)
Preparing to work new issue
-Added negative points to list of accepted commands/commands_with_target -Added logic to _extract_count for negative_emoji
-Added neg_points methods to the base storage class -Coded out neg_points methods in the InMemoryStorage class -Making lint happy
- Added logic to determine whether :NEGATIVE-EMOJI: or :EMOJI: was passed. -get_user_neg_points_remaining(user_id) coded out - 'allneg' command handling - determine whether give or giveneg was implied
- Added `kind` to 'get points remaining' functions/methods - Added handling for give negative points commands
It's unnecessary to check for NEG_POINTS == 'ALLOW'. If NEG_POINTS != 'ALLOW', the NEGATIVE_EMOJI, and NEGATIVE_POINTS environment variables won't be loaded so any check against one of those variables should return false
@@ -19,25 +19,33 @@ | |||
BOT_ID = os.environ.get("BOT_ID") | |||
EMOJI = os.environ.get('EMOJI') | |||
POINTS = os.environ.get('POINTS') | |||
SELF_POINTS = os.environ.get('SELF_POINTS', "DISALLOW") | |||
SELF_POINTS = os.environ.get('SELF_POINTS', "ALLOW") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default should be DISALLOW.
@@ -19,25 +19,33 @@ | |||
BOT_ID = os.environ.get("BOT_ID") | |||
EMOJI = os.environ.get('EMOJI') | |||
POINTS = os.environ.get('POINTS') | |||
SELF_POINTS = os.environ.get('SELF_POINTS', "DISALLOW") | |||
SELF_POINTS = os.environ.get('SELF_POINTS', "ALLOW") | |||
NEG_POINTS = os.environ.get('NEG_POINTS', "ALLOW") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default should be DISALLOW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I must have forgotten to switch those off when I was done testing
Added NEG_POINTS = 'ALLOW' / 'DISALLOW' environment variable.
If set to allow, it will expect the NEGATIVE_EMOJI, and NEGATIVE_POINTS environment variables.
Added _extract_type to FireballMessage which will return EMOJI or NEGATIVE_EMOJI
Added kind to check_user_points_remaining functions ( check_user_points_remaining(user_id, num, kind==EMOJI) ). Instead of coding another function to check negative points. Can we do things this way, or make separate functions for everything?
Added command handling to the bot
Work out leaderboard issues
Add negative points support to check_points bot commands
Add functionality to Azure/Redis storage
Other things I didn't think of
Basically hoping for a code review to make sure I'm headed in the right direction