def _check_valid_nominee(game: "Game", nominator: Player, nominee: Player): """Check that the nominee is a valid nominee, else raise an exception.""" if nominee.is_status(game, "storyteller"): # atheist nominations for st in game.storytellers: if not st.can_be_nominated(game, nominator): raise commands.BadArgument( "The storytellers cannot be nominated today.") elif not nominee.can_be_nominated(game, nominator): raise commands.BadArgument( f"{nominee.nick} cannot be nominated today.")
def _check_valid_nominee(ctx: Context, nominator: Player, nominee: Player): """Check that the nominee is a valid nominee, else raise an exception.""" if nominee.character_type(ctx) == "storyteller": # atheist nominations for st in ctx.bot.game.storytellers: if not st.can_be_nominated(ctx, nominator): raise commands.BadArgument( "The storytellers cannot be nominated today." ) elif not nominee.can_be_nominated(ctx, nominator): raise commands.BadArgument(f"{nominee.nick} cannot be nominated today.")