def challengeDescription(self, lvl): challengeDict = server.listChallenges() if lvl in challengeDict: challenge = challengeDict[lvl] self.SaySomething( "Name: %(name)s\nDescription: %(desc)s\nExample: %(example)s\n" % (challenge.name(), challenge.desc(), challenge.example())) else: self.SaySomething("Challenge does not exist :(")
def challengeDescription(self, lvl): challengeDict = server.listChallenges() if lvl in challengeDict: challenge = challengeDict[lvl] self.SaySomething( "Name: %(name)s\nDescription: %(desc)s\nExample: %(example)s\n" % (challenge.name(), challenge.desc(), challenge.example()) ) else: self.SaySomething("Challenge does not exist :(")
def listChallenges(self): challengeDict = server.listChallenges() output = "" for lvl, challenge in challengeDict.iteritems(): output += "%s: %s\n" % (lvl, challenge.name()) output += "\nTry to send\n" output += "\t<nick> desc <lvl>\n" output += "to get a description of a challenge\n" self.SaySomething(output)