コード例 #1
0
ファイル: plugin.py プロジェクト: gilaniali/contestbot
 def rankings(self, irc, msg, args, howmany):
     """[how many]
     
     Get the top [how many] players."""
     if howmany not in range(1,50):
         irc.error("Cannot do that many players.")
     else:
         irc.reply("Top %s players: %s" % (howmany,', '.join(["%s(%s)" % (rank[1],rank[4]) for rank in rankingsGetter()[:howmany]])))
コード例 #2
0
ファイル: plugin.py プロジェクト: aichallenge/contestbot
	def rankings(self, irc, msg, args, howmany):
		"""[how many]
		
		Get the top $(how many) players."""
		if howmany not in range(1,50):
			irc.error("Cannot do that many players.")
		else:
			try:
				print repr(howmany)
				irc.reply("Top %s players: %s" % (howmany,', '.join(["%s(%.1f)" % (user["username"],float(user["skill"])) for user in rankingsGetter()[:howmany]])))
			except URLError:
				irc.error("There was a problem accessing the interface to ai-contest.com")