From dbf1640b381a3fa00f367797e67c66dc78a356c8 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 3 Apr 2012 21:03:42 +0200 Subject: [PATCH] Import ircmsgs.modes() from ubotufr. --- src/ircmsgs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ircmsgs.py b/src/ircmsgs.py index 27c8f2fc7..bc3f6f338 100644 --- a/src/ircmsgs.py +++ b/src/ircmsgs.py @@ -754,6 +754,16 @@ def mode(channel, args=(), prefix='', msg=None): args = tuple(map(str, args)) return IrcMsg(prefix=prefix, command='MODE', args=(channel,)+args, msg=msg) +def modes(channel, args=(), prefix='', msg=None): + """Returns a MODE to quiet each of nicks on channel.""" + if conf.supybot.protocols.irc.strictRfc(): + assert isChannel(channel), repr(channel) + modes = args + if msg and not prefix: + prefix = msg.prefix + return IrcMsg(prefix=prefix, command='MODE', + args=[channel] + ircutils.joinModes(modes), msg=msg) + def limit(channel, limit, prefix='', msg=None): return mode(channel, ['+l', limit], prefix=prefix, msg=msg)