Commit Graph

277 Commits

Author SHA1 Message Date
Tanner a1de8858f0 Pseudo code for levels
TODO: db, checking and changing level, testing
2014-12-13 23:51:39 -06:00
Yizhe Shen bbded392cd Fixed incrementation of correct answer counter.
- Correct answers of a question increments the counter by 1 instead of
  (4-self.hintsCounter)
2014-10-21 00:28:23 -04:00
Yizhe Shen 28243c9945 Modified output of top players.
- Changed output of 'day', 'week', 'month', and 'year' commands to be
  closer to old output (v1.06 and older) when empty list is returned from
  query
2014-08-25 08:49:06 -04:00
Yizhe Shen 290a908d59 Added try statement for re.sub() for 'report' command. 2014-08-24 14:51:50 -04:00
Yizhe Shen 3a5d1b75fc Fixed typo.
- Introduced in d6dce89
2014-08-24 13:35:01 -04:00
Yizhe Shen 97e31c56e4 Removed forced addition of trailing whitespace for '^' pattern. 2014-08-23 10:15:25 -04:00
Yizhe Shen b6803834f4 Updated messages for editing errors.
- Added error message for 'edit' command when the edit is the same as the
  old question
- Updated regex error message when expression results in no change
2014-08-23 10:08:26 -04:00
Yizhe Shen 2f41a2f437 Minor fix for 'showreport' command.
- Bug introduced in b5501e5.
2014-08-23 09:43:59 -04:00
Yizhe Shen f31a45a9de Improved handling of regex. (issue #309)
- Added proper handling of regex substitution expressions in the
  'report' command
- Substitions that don't change the original question are now ignored and
  an error reply message is given
- Forced addition of trailing space when using '^' pattern since
  leading/trailing whitespace is stripped by the bot
2014-08-23 09:38:21 -04:00
Tanner 73d2ecbae4 Minor adjustments to output text 2014-08-19 19:00:31 -05:00
Yizhe Shen 9ecc3d3e4c Fixed minor syntax errors from previous commits. 2014-08-18 19:40:24 -04:00
Yizhe Shen 20a0752178 Cleaned up SQL statements for retrieving top stats. (issue #93)
- Also added new messages if queries return empty lists
2014-08-18 18:10:30 -04:00
Yizhe Shen cce93e0263 More updates to Storage methods.
- Changed query methods that return a list of rows to use
  Cursor.fetchall()
- Updated more row references from indices to keys
2014-08-18 17:32:41 -04:00
Yizhe Shen d6dce89dcc Cleaned up some SQL statements (issue #93) and refactoring.
- Cleaned up methods in Storage which return boolean or integer
- Small change in 'edit' command
2014-08-18 09:45:47 -04:00
Yizhe Shen 1890815ffb More improvements.
- Updated Storage.getQuestionByRound() to return a sqlite3.Row object
- Updated methods that use Storage.getQuestionByRound() to reference
  results using keys instead of indices (for better readability)
- Fixed 'delete' command to record the user by username instead of nick
- Added error message when regex reports has fewer than 2 arguments
- Refactored 'delete' and 'report' commands to remove excess return
  statements
2014-08-18 08:52:15 -04:00
Yizhe Shen 2d4961b195 Modified Storage.getQuestion().
- Moved the method to a more logical location
- Renamed it to Storage.getQuestionById()
2014-08-18 08:20:03 -04:00
Yizhe Shen 01bea9e5cc Fix to disallow TriviaMods from accepting their own changes.
- Affects 'acceptnew', 'acceptdelete', and 'acceptedit' commands
2014-08-18 08:15:10 -04:00
Yizhe Shen ebafcd2d2b Updated SQL queries to return sqlite3.Row objects.
- Improves overall code readability by replacing indices with keys
- Updated Storage constructor to set DB connection row_factory to
  sqlite3.Row
- Updated Storage.getByID(), Storage.getTop3() and Storage.getQuestion()
  methods to return sqlite3.Row objects
- Affects 'list', 'show', 'accept' and 'rm' commands
- Replaced some if statements with ternary expressions where apprpriate
2014-08-18 02:36:08 -04:00
Yizhe Shen b5501e524e Fix for hint command.
- Fix to prevent replies to the hint command after a KAOS question is over
2014-08-07 23:40:14 -04:00
Yizhe Shen 07dea60287 Further improvement on previous commit. 2014-07-25 22:45:32 -04:00
Yizhe Shen 6d2b49fcbb Fixed handling of 'page' parameter for 'list' commands.
- The 'page' parameter will default to the total number of pages,
  if it's greater than the total
2014-07-25 22:07:15 -04:00
Yizhe Shen 992d4ea62d Updated some output text.
- Removed leading spaces in 'add' command  messages
- Updated 'list' command messages when no data is found
2014-07-25 21:14:51 -04:00
Yizhe Shen b892751a3a Updated other commands that use a Storage.getByID() method. (issue #300)
- Also synchonized 'not found' messages
2014-07-25 20:55:26 -04:00
Yizhe Shen b7c411db56 Updated editing commands for issue #300.
- Updated all methods which use Storage.getEditById()
- Synchronized 'edit not found' messages
2014-07-25 18:31:09 -04:00
Yizhe Shen 8f92854df6 Updated Storage.getByID() methods with channel parameter.
- Channel parameter is optional
- For use in issue #300
2014-07-25 18:00:54 -04:00
Yizhe Shen 92cbbae770 Updated 'show' commands when no number is given.
- Simplified the 'show' commands to call their corresponding 'list'
  commands when no number is given so their behaviours are synchronized
2014-07-25 01:39:15 -04:00
Yizhe Shen eaca558380 Updated 'list' commands. (issue #300, #308)
- Updated Storage.getTop3() methods to take in channel parameter to pass
  into queries
- Updated 'list' commands to only show reports for the specified channel
  when not in 'globalstats' mode
- Moved Storage.getEditTop3() to a more logical location
2014-07-25 01:38:23 -04:00
Yizhe Shen e828c3732c Updated Storage.count() methods.
- Storage.count() methods now take an optional channel parameter to allow
  greater control of the query to the db
2014-07-24 22:31:41 -04:00
Yizhe Shen 7611b6905e Changed 'value' to 'key' for TimeoutList methods. 2014-07-24 21:24:13 -04:00
Yizhe Shen 681e8f6b34 Allow capability checks to be case-insensitve for channels. 2014-07-24 21:20:58 -04:00
Tanner f00f017b11 Preparations for the next update 2014-06-28 20:27:22 -05:00
Tanner 4a661f8bf9 Reduce streak bonus per #296
Reduces the streak bonus to half the question's point value, see #296
2014-06-25 13:27:58 -05:00
Tanner a641cadbd3 Improvements to readme; minor def changes
* Readme now includes information on which files to update from specific
versions to the current version.
2014-06-25 13:10:42 -05:00
Yizhe Shen b491baae1e Fixed MVP voicing to voice by nick instead of username.
- Switched the actual voicing of players to use the player's nick
- Some small formatting changes
2014-06-25 11:51:39 -04:00
Yizhe Shen 0f1f5dc7c9 Modified MVP voicing behaviour.
- MVP message will now only be shown if voice is given (ie. when there's
  no voiceTimeout for the user)
2014-06-23 21:52:49 -04:00
Yizhe Shen 170052c1b8 Fixed small error in TriviaTime.handleVoice().
- Forgot to replace an instance of 'user' with 'stat'
2014-06-23 21:43:21 -04:00
Yizhe Shen b00876be53 Small fix for TriviaTime.givepoints().
- Reverted functionality back to original state after breaking with the
  introduction of TriviaTime.getUsername()
- Still does not properly convert nick into username
2014-06-22 14:08:38 -04:00
Yizhe Shen 2b4f1f2caf Added back a check in Game.checkAnswer().
- Added back a check to see if Storage.getUserStat() actually returns a
  non-empty dict, just in case
2014-06-22 04:10:49 -04:00
Yizhe Shen 2cf3fef51d Updated Storage.getUser() and Storage.getUserRanks().
- Both methods now return dicts
- getUser() no longer appends the results of getUserRanks()
- Updated calls with new usage
- Added some comments for readability
- Renamed Storage.getUser() to Storage.getUserStat()
- Renamed Storage.getUserRanks() to Storage.getUserRank()
2014-06-21 19:46:14 -04:00
Yizhe Shen 76cdf1ba5c Add TriviaTime.getUsername().
- New method returns a user's registered username if it's a registered
  user or returns their nick if not
2014-06-21 16:26:33 -04:00
Yizhe Shen fb9feb8b44 Fixed MVP voicing.
- MVP voicing now works for week, month and year
2014-06-21 13:00:14 -04:00
Tanner 232d151f97 Preparations for future updates 2014-06-20 16:43:10 -05:00
Yizhe Shen ea2c936f2a Added check for inactive games.
- Fixes inactive game starts caused by an empty question database
2014-06-20 11:43:12 -04:00
Yizhe Shen c6ac55df9e Fix for TriviaTime.getTriviaCapability().
- Added list typecast which makes the 'in' keyword work as desired
2014-06-19 06:12:12 -04:00
Tanner cc1907e579 General minor improvements to text 2014-06-18 16:24:10 -05:00
Yizhe Shen ff9a735624 Minor fix in TriviaTime.next(). 2014-06-18 00:04:04 -04:00
Tanner eb4c2500e8 Convert tab to 4 spaces 2014-06-17 22:38:50 -05:00
Tanner e2e8592c0d Convert tab to 4 spaces 2014-06-17 22:34:06 -05:00
Tanner b9aa665364 Bug fix
Third time's the charm
2014-06-17 22:03:58 -05:00
Tanner 593148f4d3 Bug fix
for real this time ;)
2014-06-17 21:52:36 -05:00