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

138
Views
Using arguments to send emoji discord.js

Hello im trying to send emoji using args. This is code I have so far

client.on('messageCreate', message => {
    if (message.author.bot) return;
    if (message.content.indexOf(prefix) !== 0) return;

    const args = message.content.slice(prefix.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();
    
    if (command === 'f') {
        if (args[0] === 'agrona') {
            return message.channel.send(':agrona:970341615715627079');
        } else if (args[1] === 'aurora') {
            return message.channel.send(":Aurora:970341793042403449");
        } else if (args[2] === 'elizabeth') {
            return message.channel.send(":elizabeth:970341810469752862");
        } else if (args[3] === 'icy') {
            return message.channel.send(":icy:970341824633929728");
        } else if (args[4] === 'issa') {
            return message.channel.send(":issa:970341862680440882");
        }
        
        message.channel.send(`${args[0]} ${args[1]} ${args[2]} ${args[3]} ${args[4]}`);
    }
});

I event tried to define it like this but it didnt work:

if (command === 'f') {
        if (args[0] === 'agrona') {
        const Emoji = message.guild.emojis.cache.find(emoji => emoji.name === 'agrona');
            return message.channel.send(`${Emoji});

But all I got was undefined response from bot. Can anyone help me with this? Thanks.

about 4 years ago · Juan Pablo Isaza
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!