def vote(bot, game):
log.info('vote called')
#When voting starts we start the counter to see later with the vote/calltovote command we can see who voted.
game.dateinitvote = datetime.datetime.now()
strcid = str(game.cid)
btns = [[InlineKeyboardButton("Ja", callback_data=strcid + "_Ja"),
InlineKeyboardButton("Nein", callback_data=strcid + "_Nein")]]
voteMarkup = InlineKeyboardMarkup(btns)
for uid in game.playerlist:
if not game.playerlist[uid].is_dead:
if game.playerlist[uid] is not game.board.state.nominated_president:
# the nominated president already got the board before nominating a chancellor
bot.send_message(uid, game.board.print_board())
bot.send_message(uid,
"Do you want to elect President %s and Chancellor %s?" % (
game.board.state.nominated_president.name, game.board.state.nominated_chancellor.name),
reply_markup=voteMarkup)
评论列表
文章目录