mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-07 12:03:43 -05:00
Move me/botnick to SupyMisc + add getchan command
This commit is contained in:
parent
977acb57f7
commit
b5b6dd69ba
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user