tanaallen
tanaallen

Reputation: 69

Discord.JS How to use args

I am trying to use args [] but I don't know how to make it work somehow.

I want to set an emoji and then write something that bot will post it. for example:

  .setDescription(`emoji args[0]\n\nEmoji2 args[1]`)

so it outputs to the channel

1st line -> emoji MyText 2nd line -> Emoji2 MySecondText

Upvotes: 0

Views: 77

Answers (1)

Skulaurun Mrusal
Skulaurun Mrusal

Reputation: 2847

From MDN docs about Template literals:

Template literals can contain placeholders. These are indicated by the dollar sign and curly braces (${expression}).

const args = ["🍉", "🥝"];
console.log(`Emoji1: ${args[0]}\n\nEmoji2: ${args[1]}`);

Upvotes: 1

Related Questions