Add a check for an int id so people who use 'note get' will understand the error message more.

This commit is contained in:
Jeremy Fincher 2004-01-06 02:40:16 +00:00
parent 553d7d6060
commit 8d6956f4ae

View File

@ -199,6 +199,11 @@ class Note(callbacks.Privmsg):
except KeyError: except KeyError:
irc.error(msg, conf.replyNotRegistered) irc.error(msg, conf.replyNotRegistered)
return return
try:
noteid = int(noteid)
except ValueError:
irc.error(msg, '%r is not a valid note id.' % noteid)
return
db = self.dbHandler.getDb() db = self.dbHandler.getDb()
cursor = db.cursor() cursor = db.cursor()
cursor.execute("""SELECT note, to_id, from_id, added_at, public cursor.execute("""SELECT note, to_id, from_id, added_at, public