diff --git a/config.py b/config.py index d6d2956..9f1e3b8 100644 --- a/config.py +++ b/config.py @@ -35,7 +35,7 @@ conf.registerChannelValue(TriviaTime.admin, 'sqlitedb', conf.registerChannelValue(TriviaTime.admin, 'quizfile', registry.NormalizedString("""plugins/TriviaTime/storage/samplequestions""", - """Location of question file""") + """Location of question file. Changes require reloading the plugin""") ) # timeout, number of hints, values @@ -51,7 +51,7 @@ conf.registerChannelValue(TriviaTime.commands, 'showHintCommandKAOS', conf.registerChannelValue(TriviaTime.general, 'globalStats', registry.Boolean(False, - """Stats are global accross all channels""") + """Stats are global across all channels""") ) conf.registerChannelValue(TriviaTime.hints, 'vowelsHint', diff --git a/plugin.py b/plugin.py index 3cabe85..ebbf8d3 100644 --- a/plugin.py +++ b/plugin.py @@ -779,6 +779,19 @@ class TriviaTime(callbacks.Plugin): irc.sendMsg(ircmsgs.notice(username, 'NEW: %s' % (newQuestionText))) irc.sendMsg(ircmsgs.notice(username, 'OLD: %s' % (question[2]))) return + elif str.lower(utils.str.normalizeWhitespace(inp)) == 'delete': + if not threadStorage.questionIdExists(question[0]): + irc.error('That question does not exist.') + return + if threadStorage.isQuestionDeleted(question[0]): + irc.error('That question is already deleted.') + return + if threadStorage.isQuestionPendingDeletion(question[0]): + irc.error('That question is already pending deletion.') + return + irc.reply('Marked question for deletion.') + threadStorage.insertDelete(username, channel, question[0]) + return threadStorage.updateUser(username, 0, 0, 1) threadStorage.insertReport(channel, username, text, question[0]) irc.reply('Your report has been submitted!')