1.0.0 • Published 5 years ago

pokemon-showdown-validator v1.0.0

Weekly downloads
1
License
GPL3
Repository
-
Last release
5 years ago

Pokemon Showdown Validator

Validates a pokemon team with pokemon showdown via websockets.

It's not pretty. It will most likely never be updated. This was a one shot I can't be bothered to clean up. Use on your own volition.

Most of the code has been sourced from @Zarel's PokemonShowdown repositories:

Installation

$ npm install BeMacized/PokemonShowdownValidator

Usage

Syntax

validate(text [, format]);

Return value: Promise\<string>

Parameters

text: string: A team (In the pokemon showdown syntax, see example below)

format: string (optional): The format to validate for (default: "gen7ou")

Example code

// Import validation function
const validate = require('pokemon-showdown-validator').default;

// Define team
const team = `
Skuntank (M) @ Life Orb
Ability: Stench
Shiny: Yes
EVs: 252 Atk / 4 SpD / 252 Spe
Jolly Nature
- Poison Jab
- Foul Play
- Defog
- Play Rough

Skuntank (M) @ Life Orb
Ability: Stench
Shiny: Yes
EVs: 252 Atk / 4 SpD / 252 Spe
Jolly Nature
- Poison Jab
- Foul Play
- Defog
- Play Rough
`;

// Call validation on team
validate(team).then(response => {
  console.log(response);
  /*
  Your team was rejected for the following reasons:

  - You are limited to one of each Pokémon by Species Clause.

  - (You have more than one Skuntank)
  */  
});

Formats

Any of the following values are valid for the format parameter:

  • gen7ou (DEFAULT)
  • gen7ubers
  • gen7uu
  • gen7ru
  • gen7nu
  • gen7pu
  • gen7lc
  • gen7monotype
  • gen7anythinggoes
  • gen7cap
  • gen7caplc
  • gen7battlespotsingles
  • gen7battlespotspecial6
  • gen7doublesou
  • gen7doublesubers
  • gen7doublesuu
  • gen7vgc2017
  • gen7battlespotdoubles
  • gen7fullpotential
  • gen7dualwielding
  • gen7balancedhackmons
  • gen71v1
  • gen7mixandmega
  • gen7almostanyability
  • gen7camomons
  • gen7stabmons
  • gen72v2doubles
  • gen6gennextou
  • gen5pu
  • gen6ou
  • gen6ubers
  • gen6uu
  • gen6ru
  • gen6nu
  • gen6pu
  • gen6lc
  • gen6anythinggoes
  • gen6monotype
  • gen6cap
  • gen6battlespotsingles
  • gen6inversebattle
  • gen6doublesou
  • gen6doublesubers
  • gen6doublesuu
  • gen6vgc2016
  • gen6battlespotdoubles
  • gen6battlespottriples
  • gen5ou
  • gen5ubers
  • gen5uu
  • gen5ru
  • gen5nu
  • gen5lc
  • gen5gbusingles
  • gen5doublesou
  • gen5gbudoubles
  • gen4ou
  • gen4ubers
  • gen4uu
  • gen4lc
  • gen3ou
  • gen3ubers
  • gen2ou
  • gen2ubers
  • gen1ou
  • gen1ubers
  • gen1stadium

Development

Modify source files in src/.

Compile from typescript using $ npm run build