Skip to content

Commit

Permalink
fuck i committed the wrong file in the commit before this
Browse files Browse the repository at this point in the history
  • Loading branch information
Glazelf committed May 14, 2024
1 parent 7e2b6be commit 314811f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions util/pokemon/getWhosThatPokemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ module.exports = async ({ pokemonList, censor }) => {
let pokemon, pokemonID, serebiiRender;
while (!doesRenderExist) {
pokemon = getRandomObjectItem(pokemonList);
console.log(pokemon.name)
pokemonID = getCleanPokemonID(pokemon);
serebiiRender = `https://www.serebii.net/pokemon/art/${pokemonID}.png`;
doesRenderExist = await imageExists(serebiiRender);
};
// Catch identical forms
let correctAnswer = pokemon.name;
let totemFormString = "-Totem";
if (correctAnswer.endsWith(totemFormString)) correctAnswer = correctAnswer.replace(totemFormString, "");
if (correctAnswer.startsWith("Arceus") || correctAnswer.startsWith("Silvally")) correctAnswer = correctAnswer.split("-")[0];
// Initiate image context
let img = await Canvas.loadImage(serebiiRender);
let canvas = Canvas.createCanvas(img.width, img.height); // Serebii renders seem to always be 475x475
Expand All @@ -32,6 +26,6 @@ module.exports = async ({ pokemonList, censor }) => {
};
pokemonFiles = new Discord.AttachmentBuilder(canvas.toBuffer());
returnString = `# Who's That Pokémon?`;
pokemonButtons.addComponents(new Discord.ButtonBuilder({ customId: `pkmQuiz|${correctAnswer}`, label: "Guess!", style: Discord.ButtonStyle.Primary }));
pokemonButtons.addComponents(new Discord.ButtonBuilder({ customId: `pkmQuiz|${pokemon.name}`, label: "Guess!", style: Discord.ButtonStyle.Primary }));
return { content: returnString, files: [pokemonFiles], components: [pokemonButtons] };
};

0 comments on commit 314811f

Please sign in to comment.