From 9457f4dbe7c7b14b9c2d4487e9b9c598001e9398 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Wed, 1 Jan 2014 20:46:09 +0000 Subject: [PATCH] =?UTF-8?q?Misc:=20Add=20command=20@noticetell=20to=20repl?= =?UTF-8?q?ace=20=E2=80=9C@notice=20[tell=20]=E2=80=9D=20which=20is=20no?= =?UTF-8?q?=20longer=20possible=20since=20f0233c37.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Misc/plugin.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 9cd1a3c87..8cea01705 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -507,13 +507,7 @@ class Misc(callbacks.Plugin): 'regexp': 'regexpMatcher',})]) - @internationalizeDocstring - def tell(self, irc, msg, args, target, text): - """ - - Tells the whatever is. Use nested commands to your - benefit here. - """ + def _tell(self, irc, msg, args, target, text, notice): if irc.nested: irc.error('This command cannot be nested.', Raise=True) if target.lower() == 'me': @@ -536,9 +530,28 @@ class Misc(callbacks.Plugin): text = '* %s %s' % (irc.nick, text) s = _('%s wants me to tell you: %s') % (msg.nick, text) irc.replySuccess() - irc.reply(s, to=target, private=True) + irc.reply(s, to=target, private=True, notice=notice) + + @internationalizeDocstring + def tell(self, *args): + """ + + Tells the whatever is. Use nested commands to your + benefit here. + """ + self._tell(*args, notice=False) tell = wrap(tell, ['something', 'text']) + @internationalizeDocstring + def noticetell(self, *args): + """ + + Tells the whatever is, in a notice. Use nested + commands to your benefit here. + """ + self._tell(*args, notice=True) + noticetell = wrap(noticetell, ['something', 'text']) + @internationalizeDocstring def ping(self, irc, msg, args): """takes no arguments