Move me/botnick to SupyMisc + add getchan command

This commit is contained in:
GLolol 2014-03-14 17:50:52 -07:00
parent 977acb57f7
commit b5b6dd69ba
2 changed files with 25 additions and 14 deletions

View File

@ -76,20 +76,6 @@ class Hostmasks(callbacks.Plugin):
irc.reply(self._SplitHostmask(irc, nick)[1])
getident = wrap(getident, [(additional('nick'))])
def me(self, irc, msg, args):
"""takes no arguments.
Returns the nick of the person who called the command.
"""
irc.reply(msg.nick)
me = wrap(me)
def botnick(self, irc, msg, args):
"""takes no arguments.
Returns the nick of the bot.
"""
irc.reply(irc.nick)
me = wrap(me)
def _isv4IP(self, ipstr):
try:
socket.inet_aton(ipstr)

View File

@ -70,7 +70,32 @@ class SupyMisc(callbacks.Plugin):
Counts the amount of channels the bot is on. """
irc.reply(len(irc.state.channels.keys()))
chancount = wrap(chancount)
def getchan(self, irc, msg, args):
"""takes no arguments.
Returns the name of the current channel. """
channel = msg.args[0]
if ircutils.isChannel(channel):
irc.reply(channel)
else:
irc.reply(None)
getchan = wrap(getchan)
def me(self, irc, msg, args):
"""takes no arguments.
Returns the nick of the person who called the command.
"""
irc.reply(msg.nick)
me = wrap(me)
def botnick(self, irc, msg, args):
"""takes no arguments.
Returns the nick of the bot.
"""
irc.reply(irc.nick)
botnick = wrap(botnick)
Class = SupyMisc