Cleanup & ideas

This commit is contained in:
Collin Rapp
2020-08-25 22:23:16 -07:00
parent df63269739
commit 2387e67004
13 changed files with 163 additions and 24 deletions

View File

View File

@@ -2,6 +2,8 @@
## General
* [X] Initial/Basic Logging
* Especially when unable to handle a comment
## File-Specific
### bot.py

View File

@@ -20,3 +20,22 @@ To ensure that a point is awarded to the correct user:
could simple check that one of the comments in the comment tree belongs to
that user, and then award them the point.
- Honestly, this is probably overcomplicated and unnecessary, though.
## Multiple behaviors
Implement the concept of actions, with a mapping between trigger keywords/patterns and actions. This will allow for multiple behaviors (eg mark as solved for one behavior, and just show points when summoned for another).
Maybe allow chains of actions. For example:
1. OP comments "!solved"
2. Bot receives comment
3. Action 1: Determine whether is "!solved" comment
4. Action 2: Determine solver
5. Action 3: Add points
6. Action 4: Reply
## Making the bot easier to configure
Allow bot user to just specify a list of strings to recognize to trigger the bot's response. Allow user to specify whether case-sensitive. Ways to do this, with varying performance:
* Just search each text for each keyword;
* Use `re.compile()` for each keyword before searching (*may* be faster?); or
* Build a binary search tree for all keywords for each action

View File

@@ -2,4 +2,3 @@
## End-to-end Testing Scenarios

View File

@@ -6,10 +6,17 @@ File-specific lists are in loose descending order of priority.
n/a
## Bugs
* [ ] Users can get multiple points for same solution
- Scenario:
- OP comments !solved
- OP deletes !solved comment
- OP comments !solved again
- Hopefully this will be easily solved once db migrations are working
## General
* [ ] Logging
* Especially when unable to handle a comment
* [ ] Notifications
* Let admins know if a comment can't be properly handled
* Email preferable; could do Reddit message, too
@@ -17,6 +24,7 @@ n/a
* [ ] Testing
- Any PRAW model that inherits from `praw.PRAWBase` has a `parse` method
that could perhaps be used to make fake objects for testing
- Add regression tests for comments, etc.?
* [ ] GUI
- [ ] Create a GUI for configuring and running the bot, and performing other jobs
like adding or subtracting points for specific redditors
@@ -52,6 +60,7 @@ n/a
### bot.py
* [ ] (Maybe) sanitize input text?
* [ ] Now that the date of each solution is being stored, can check for missed
submissions each time the bot is run by searching subreddit history until
last solution found