|
@@ -48,9 +48,10 @@ export class Stickers {
|
|
|
documentation: { description: "Lists all available stickers", example: "stickers" }
|
|
|
})
|
|
|
async listStickers({ message }: ICommandData): Promise<void> {
|
|
|
- const m = Object.keys(this.stickers)
|
|
|
- .filter(s => Object.prototype.hasOwnProperty.call(this.stickers, s))
|
|
|
- .reduce((prev, cur, i) => `${prev} !${cur}${i != 0 && i % STICKERS_PER_ROW == 0 ? "\n" : ""}`, "");
|
|
|
+ const stickerNames = Object.keys(this.stickers)
|
|
|
+ .filter(s => Object.prototype.hasOwnProperty.call(this.stickers, s));
|
|
|
+ const maxLength = stickerNames.map(s => s.length).reduce((prev, cur) => Math.max(prev, cur), 0);
|
|
|
+ const m = stickerNames.reduce((prev, cur, i) => `${prev}!${cur}${" ".repeat(maxLength - cur.length + 2)}${(i + 1) % STICKERS_PER_ROW == 0 ? "\n" : ""}`, "");
|
|
|
|
|
|
let toSend = `${message.author.toString()}, I have the following stickers:\n\`\`\``;
|
|
|
const rows = m.split("\n");
|