mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added hexip command.
This commit is contained in:
parent
550f0fb3de
commit
d21d868b28
@ -175,6 +175,22 @@ class FunCommands(callbacks.Privmsg):
|
||||
(self.recvdMsgs, self.recvdBytes,
|
||||
self.sentMsgs, self.sentBytes))
|
||||
|
||||
def hexip(self, irc, msg, args):
|
||||
"""<ip>
|
||||
|
||||
Returns the hexadecimal IP for that IP.
|
||||
"""
|
||||
ip = privmsgs.getArgs(args)
|
||||
if not ircutils.isIP(ip):
|
||||
irc.error(msg, '%r is not a valid IP.' % ip)
|
||||
return
|
||||
quads = ip.split('.')
|
||||
ret = ""
|
||||
for quad in quads:
|
||||
i = int(quad)
|
||||
ret += '%02x' % i
|
||||
irc.reply(msg, ret.upper())
|
||||
|
||||
def ord(self, irc, msg, args):
|
||||
"""<letter>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user