Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
get args from message content
var number = args.slice(1).join(' ');
var amount = args.slice(2).join(' ');

const PaymentEmbed = new Discord.MessageEmbed()
  .setTitle(`Payment`)
  .setColor('#ccccff')
  .addField(`For ${number}, csgo commends\n
    Please send **${amount}€** through paypal\n`);

message.channel.send(PaymentEmbed);

By using !command n 100 1 I get up with this message:

For 100 1, csgo commends Please send 1€ through paypal :warning: LEAVE THE PAYMENT DESCRIPTION / MESSAGE EMPTY :warning: undefined

I shouldn't get undefined and at the first array I get "100 1" and I should only see "100".

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I guess you are using the standard way to collect the arguments from a message. In this case "args" is an array and you can access its values by index.

const number = args[1];
const amount = args[2];

These are example indexes and you might need to change them to get the correct input values.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!