- state.nextq = state.questions[qid]
- if user.glevel >= lib.STAFF:
- respstr = "Done. Next question is: %s" % (state.nextq[0])
- else:
- respstr = "Done."
- bot.msg(user, respstr)
- except Exception as e:
- bot.msg(user, "Error: %s" % (e))
+ except ValueError:
+ bot.msg(user, "Error: QID must be a number.")
+ return
+ if qid >= len(state.questions):
+ bot.msg(user, "Error: no such QID.")
+ return
+ state.nextqid = qid
+ bot.msg(user, "Done. Next question is %d: %s" % (qid, state.questions[qid][0]))