mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Added the id of the just-added todo to the reply.
This commit is contained in:
parent
b0fa390f99
commit
a40742edb7
@ -189,11 +189,15 @@ class Todo(callbacks.Privmsg):
|
|||||||
return
|
return
|
||||||
text = privmsgs.getArgs(rest, required=1)
|
text = privmsgs.getArgs(rest, required=1)
|
||||||
cursor = self.db.cursor()
|
cursor = self.db.cursor()
|
||||||
|
now = int(time.time())
|
||||||
cursor.execute("""INSERT INTO todo
|
cursor.execute("""INSERT INTO todo
|
||||||
VALUES (NULL, %s, %s, %s, %s, 1)""",
|
VALUES (NULL, %s, %s, %s, %s, 1)""",
|
||||||
priority, int(time.time()), id, text)
|
priority, now, id, text)
|
||||||
self.db.commit()
|
self.db.commit()
|
||||||
irc.reply(msg, conf.replySuccess)
|
cursor.execute("""SELECT id FROM todo
|
||||||
|
WHERE added_at=%s AND userid=%s""", now, id)
|
||||||
|
todoId = cursor.fetchone()[0]
|
||||||
|
irc.reply(msg, '%s (Todo #%s added)' % (conf.replySuccess, todoId)))
|
||||||
|
|
||||||
def remove(self, irc, msg, args):
|
def remove(self, irc, msg, args):
|
||||||
"""<task id>
|
"""<task id>
|
||||||
|
Loading…
Reference in New Issue
Block a user