From ba052ee6051dd40e2575abd08e44d3d17bab72b0 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Mon, 24 Jan 2022 18:58:48 +0500 Subject: [PATCH] fix --- commands/Images/steamcard.js | 8 ++++---- helpers/functions.js | 1 + languages/ru-RU/images/steamcard.json | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/commands/Images/steamcard.js b/commands/Images/steamcard.js index ca7c9e4f..f7799c43 100644 --- a/commands/Images/steamcard.js +++ b/commands/Images/steamcard.js @@ -17,15 +17,15 @@ class SteamCard extends Command { } async run(message, args) { - const text = args.join(" "); - if (!text) return message.error("images/qrcode:MISSING_TEXT"); + const nArgs = args.join(" ").split(new RegExp(/ <@!(\d+)>/)); + if (!args[0]) return message.error("images/qrcode:MISSING_TEXT"); - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(nArgs[1]) || message.author; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); const buffer = await this.client.AmeAPI.generate("steamcard", { - text: text, + text: nArgs[0], url: user.displayAvatarURL({ format: "png", size: 512 diff --git a/helpers/functions.js b/helpers/functions.js index 7ec6a398..96c9d56e 100644 --- a/helpers/functions.js +++ b/helpers/functions.js @@ -8,6 +8,7 @@ module.exports = { /** * Gets message prefix * @param {object} message The Discord message + * @param {object} data Server data * @returns The prefix */ getPrefix(message, data) { diff --git a/languages/ru-RU/images/steamcard.json b/languages/ru-RU/images/steamcard.json index 213f2d00..d93ef85f 100644 --- a/languages/ru-RU/images/steamcard.json +++ b/languages/ru-RU/images/steamcard.json @@ -1,5 +1,5 @@ { "DESCRIPTION": "Создать изображение \"steamcard\"", - "USAGE": "{{prefix}}steamcard (@пользователь)", - "EXAMPLES": "{{prefix}}steamcard\n{{prefix}}steamcard @Jonny_Bro#4226" + "USAGE": "{{prefix}}steamcard [текст] (@пользователь)", + "EXAMPLES": "{{prefix}}steamcard Коллекционная карточка\n{{prefix}}steamcard Карточка @Jonny_Bro#4226" } \ No newline at end of file