padStart instead of Util.pad

This commit is contained in:
Daniel Odendahl Jr
2018-01-28 02:04:04 +00:00
parent d63cfef8a0
commit d58364a3d1
6 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ module.exports = class CardsAgainstHumanityCommand extends Command {
return msg.say('Game could not be started...');
}
const players = await this.generatePlayers(awaitedPlayers);
let czars = Array.from(players.values());
const czars = Array.from(players.values());
let winner = null;
while (!winner) {
const czar = czars[0];
+2 -2
View File
@@ -1,7 +1,7 @@
const { Command } = require('discord.js-commando');
const { createCanvas, loadImage } = require('canvas');
const snekfetch = require('snekfetch');
const { filterPkmn, pad } = require('../../util/Util');
const { filterPkmn } = require('../../util/Util');
const { silhouette } = require('../../util/Canvas');
module.exports = class WhosThatPokemonCommand extends Command {
@@ -43,7 +43,7 @@ module.exports = class WhosThatPokemonCommand extends Command {
}
const names = data.names.map(name => name.name.toLowerCase());
const displayName = filterPkmn(data.names).name;
const id = pad(data.id.toString(), '000');
const id = data.id.toString().padStart(3, '0');
const image = await snekfetch.get(`https://www.serebii.net/sunmoon/pokemon/${id}.png`);
let attachment = image.body;
if (hide) {