mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Added dcc, to build dcc privmsgs.
This commit is contained in:
parent
16ebd1c2ba
commit
6cc8c29a6b
@ -481,6 +481,16 @@ def privmsg(recipient, msg, prefix=''):
|
||||
assert msg, 'msg must not be empty.'
|
||||
return IrcMsg(prefix=prefix, command='PRIVMSG', args=(recipient, msg))
|
||||
|
||||
def dcc(recipient, kind, *args, **kwargs):
|
||||
# Stupid Python won't allow (recipient, kind, *args, prefix=''), so we have
|
||||
# to use the **kwargs form. Blech.
|
||||
assert ircutils.isNick(recipient), 'Can\'t DCC a channel.'
|
||||
kind = kind.upper()
|
||||
assert kind in ('SEND', 'CHAT', 'RESUME', 'ACCEPT'), 'Invalid DCC command.'
|
||||
args.insert(0, kind)
|
||||
return IrcMsg(prefix=kwargs.get('prefix', ''), command='PRIVMSG',
|
||||
args=(recipient, ' '.join(args)))
|
||||
|
||||
def action(recipient, msg, prefix=''):
|
||||
"""Returns a PRIVMSG ACTION to recipient with the message msg."""
|
||||
if conf.supybot.protocols.irc.strictRfc():
|
||||
|
Loading…
Reference in New Issue
Block a user