From b4f4812c5341603a3324e2f8a4e0f65e55be0cf4 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 4 Dec 2017 23:45:32 -0800 Subject: [PATCH] Add F --- pyircbot/modules/PressF.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pyircbot/modules/PressF.py diff --git a/pyircbot/modules/PressF.py b/pyircbot/modules/PressF.py new file mode 100644 index 0000000..9138734 --- /dev/null +++ b/pyircbot/modules/PressF.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +""" +.. module:: PressF + :synopsis: Press F to pay respects + +.. moduleauthor:: Dave Pedu + +""" + +from pyircbot.modulebase import ModuleBase, regex +from time import time + + +class PressF(ModuleBase): + def __init__(self, bot, moduleName): + ModuleBase.__init__(self, bot, moduleName) + self.last = 0 + + @regex(r'F', types=['PRIVMSG'], allow_private=False) + def respect(self, msg, cmd): + if time() - self.last > self.config.get("delay", 5): + self.last = time() + self.bot.act_PRIVMSG(msg.args[0], "F")