commented core more
This commit is contained in:
parent
72babfceb2
commit
51c866de6d
1 changed files with 10 additions and 5 deletions
15
core/main.py
15
core/main.py
|
@ -13,28 +13,33 @@ class Input(dict):
|
||||||
if chan == conn.nick.lower(): # is a PM
|
if chan == conn.nick.lower(): # is a PM
|
||||||
chan = nick
|
chan = nick
|
||||||
|
|
||||||
def say(msg, chan=chan):
|
def say(msg):
|
||||||
|
"""sends a message to the current channel/user"""
|
||||||
conn.msg(chan, msg)
|
conn.msg(chan, msg)
|
||||||
|
|
||||||
def pm(msg, nick=nick):
|
def msg(msg, nick=nick):
|
||||||
|
"""sends a message to a specific channel/user"""
|
||||||
conn.msg(nick, msg)
|
conn.msg(nick, msg)
|
||||||
|
|
||||||
def reply(msg, chan=chan):
|
def reply(msg, chan=chan):
|
||||||
|
"""sends a message to the current channel/user with a prefix"""
|
||||||
if chan == nick: # PMs don't need prefixes
|
if chan == nick: # PMs don't need prefixes
|
||||||
conn.msg(chan, msg)
|
conn.msg(chan, msg)
|
||||||
else:
|
else:
|
||||||
conn.msg(chan, u'(' + nick + u') ' + msg)
|
conn.msg(chan, u'(' + nick + u') ' + msg)
|
||||||
|
|
||||||
def action(msg, chan=chan):
|
def action(msg, chan=chan):
|
||||||
|
"""sends an action to the current channel/user or a specific channel/user"""
|
||||||
conn.msg(chan, u"\x01{} {}\x01".format("ACTION", msg))
|
conn.msg(chan, u"\x01{} {}\x01".format("ACTION", msg))
|
||||||
|
|
||||||
def notice(msg, nick=nick):
|
def notice(msg, chan=chan):
|
||||||
conn.cmd('NOTICE', [nick, msg])
|
"""sends a notice to the current channel/user or a specific channel/user"""
|
||||||
|
conn.cmd('NOTICE', [chan, msg])
|
||||||
|
|
||||||
dict.__init__(self, conn=conn, raw=raw, prefix=prefix, command=command,
|
dict.__init__(self, conn=conn, raw=raw, prefix=prefix, command=command,
|
||||||
params=params, nick=nick, user=user, host=host, mask=mask,
|
params=params, nick=nick, user=user, host=host, mask=mask,
|
||||||
paraml=paraml, msg=msg, server=conn.server, chan=chan,
|
paraml=paraml, msg=msg, server=conn.server, chan=chan,
|
||||||
notice=notice, say=say, reply=reply, pm=pm, bot=bot,
|
notice=notice, say=say, reply=reply, msg=msg, bot=bot,
|
||||||
action=action, lastparam=paraml[-1])
|
action=action, lastparam=paraml[-1])
|
||||||
|
|
||||||
# make dict keys accessible as attributes
|
# make dict keys accessible as attributes
|
||||||
|
|
Reference in a new issue