From 202ea9385442db1c33bba989a3c8c8742a7534ce Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 19 Feb 2014 17:20:51 -0500 Subject: [PATCH] Add a bunch of functionality to !remind (#43). --- earwigbot/commands/remind.py | 250 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 226 insertions(+), 24 deletions(-) diff --git a/earwigbot/commands/remind.py b/earwigbot/commands/remind.py index bb0c873..2ecbacb 100644 --- a/earwigbot/commands/remind.py +++ b/earwigbot/commands/remind.py @@ -20,43 +20,245 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from threading import Timer +from itertools import chain +import random +from threading import Thread import time from earwigbot.commands import Command +DISPLAY = ["display", "show", "list", "info"] +CANCEL = ["cancel", "stop", "delete", "del"] +SNOOZE = ["snooze", "delay", "reset", "adjust"] + class Remind(Command): """Set a message to be repeated to you in a certain amount of time.""" name = "remind" - commands = ["remind", "reminder"] + commands = ["remind", "reminder", "reminders", "snooze"] - def process(self, data): - if not data.args: - msg = "Please specify a time (in seconds) and a message in the following format: !remind