From e5021795c584315610db52a9cd8b1229d23a16ca Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Thu, 29 Sep 2016 11:12:07 +0100 Subject: [PATCH] Configurable idletime. --- bot.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 123fbf4..c2ae990 100755 --- a/bot.py +++ b/bot.py @@ -342,6 +342,15 @@ def do_commands(message, command, raw, non_admin): print('Live mode') dryrun = False + elif command == 'idle': + # idle + m = re.match(r'\bidle\s+(\d+)\b', raw.lower()) + if m is None: + yield from say(message.channel, 'Sorry!') + return + + idletime = int(m.group(1)) + elif command == 'rss': # rss m = re.match(r'\brss\s+(\d+)\b', raw.lower()) @@ -521,7 +530,7 @@ modules = { 'admin': { 'fn': do_commands, 'args': [False], - 'commands': ['avatar', 'debug', 'delete', 'dryrun', 'rss'] + 'commands': ['avatar', 'debug', 'delete', 'dryrun', 'idle', 'rss'] }, 'any': { 'fn': do_commands, -- 2.7.4