From c450d71f846ef7b9a4890a40fd05fa4c590f81e7 Mon Sep 17 00:00:00 2001 From: Ken Spencer Date: Sat, 19 Nov 2016 00:55:03 -0500 Subject: [PATCH] classes: add irc.error() for easier error replies --- classes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes.py b/classes.py index fb90c3c..5b6c141 100644 --- a/classes.py +++ b/classes.py @@ -535,6 +535,12 @@ class Irc(): self.msg(target, text, notice=notice, source=source, loopback=loopback) + def error(self, text, notice=False, source=None, private=False, force_privmsg_in_private=False, + loopback=True): + """Replies with an error to the last caller in the right context (channel or PM).""" + # This is a stub to alias error to reply + self.reply("Error: %s" % text, notice=notice, source=source, loopback=loopback) + def toLower(self, text): """Returns a lowercase representation of text based on the IRC object's casemapping (rfc1459 or ascii)."""