Search code examples
javascriptbotsdiscord.jsargs

Remove the "," when sending multiple arguments


module.exports = {
    name: 'say',
    description: 'Makes the Bot say something you want.',
    execute(message, args) {
        if (!args.length) {
            return message.channel.send(You didn't provide me anything to say, ${message.author}!);
        }

        message.channel.send(${args});
    },
};

Is there a way when i make !say multiple words the bot doesnt gives it out like this: I,am,here,hello . Is there a way to get the "," away?


Solution

  • You have to use .join() to join array values together.

    So you need to do message.channel.send(args.join(' '));