mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Made sure to depluralize the command name.
This commit is contained in:
parent
6e46263279
commit
ee5de6e0d7
@ -115,10 +115,11 @@ class Lookup(callbacks.Privmsg):
|
|||||||
|
|
||||||
Adds a lookup for <name> with the key/value pairs specified in the
|
Adds a lookup for <name> with the key/value pairs specified in the
|
||||||
colon-delimited file specified by <filename>. <filename> is searched
|
colon-delimited file specified by <filename>. <filename> is searched
|
||||||
for in conf.dataDir. Use 'lookup <name> <key>' to get the value of
|
for in conf.dataDir. If <name> is not singular, we try to make it
|
||||||
the key in the file.
|
singular before creating the command.
|
||||||
"""
|
"""
|
||||||
(name, filename) = privmsgs.getArgs(args, required=2)
|
(name, filename) = privmsgs.getArgs(args, required=2)
|
||||||
|
name = utils.depluralize(name)
|
||||||
db = getDb()
|
db = getDb()
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
try:
|
try:
|
||||||
@ -150,7 +151,7 @@ class Lookup(callbacks.Privmsg):
|
|||||||
db.commit()
|
db.commit()
|
||||||
self.addCommand(name)
|
self.addCommand(name)
|
||||||
cb = irc.getCallback('Alias')
|
cb = irc.getCallback('Alias')
|
||||||
irc.reply(msg, conf.replySuccess)
|
irc.reply(msg, '%s (lookup %s added)' % (conf.replySuccess, name))
|
||||||
|
|
||||||
def addCommand(self, name):
|
def addCommand(self, name):
|
||||||
def f(self, irc, msg, args):
|
def f(self, irc, msg, args):
|
||||||
|
Loading…
Reference in New Issue
Block a user