This commit is contained in:
JonnyBro 2022-01-24 18:58:48 +05:00
parent 31205292d7
commit ba052ee605
3 changed files with 7 additions and 6 deletions

View file

@ -17,15 +17,15 @@ class SteamCard extends Command {
} }
async run(message, args) { async run(message, args) {
const text = args.join(" "); const nArgs = args.join(" ").split(new RegExp(/ <@!(\d+)>/));
if (!text) return message.error("images/qrcode:MISSING_TEXT"); 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, { const m = await message.sendT("misc:PLEASE_WAIT", null, {
prefixEmoji: "loading" prefixEmoji: "loading"
}); });
const buffer = await this.client.AmeAPI.generate("steamcard", { const buffer = await this.client.AmeAPI.generate("steamcard", {
text: text, text: nArgs[0],
url: user.displayAvatarURL({ url: user.displayAvatarURL({
format: "png", format: "png",
size: 512 size: 512

View file

@ -8,6 +8,7 @@ module.exports = {
/** /**
* Gets message prefix * Gets message prefix
* @param {object} message The Discord message * @param {object} message The Discord message
* @param {object} data Server data
* @returns The prefix * @returns The prefix
*/ */
getPrefix(message, data) { getPrefix(message, data) {

View file

@ -1,5 +1,5 @@
{ {
"DESCRIPTION": "Создать изображение \"steamcard\"", "DESCRIPTION": "Создать изображение \"steamcard\"",
"USAGE": "{{prefix}}steamcard (@пользователь)", "USAGE": "{{prefix}}steamcard [текст] (@пользователь)",
"EXAMPLES": "{{prefix}}steamcard\n{{prefix}}steamcard @Jonny_Bro#4226" "EXAMPLES": "{{prefix}}steamcard Коллекционная карточка\n{{prefix}}steamcard Карточка @Jonny_Bro#4226"
} }