I've been coding with Python for Discord but I wanted to make the switch to JS as there is more. I'm having trouble formatting a line of code, I've downloaded this music bot to test and be come familiar with JS. It was sending an embed but I want text. Here is the line of code:
if (this.textChannel) this.textChannel.send(f"Playing ๐ถ Now playing ${this.current.info.title} - Right Now!");
I know in Python it would be something like:
await ctx.send(f"Playing ๐ถ Now playing ${this.current.info.title} - Right Now!").
What is the equivalent to f?
In Javascript, use backticks (`) for a template string
let a = 123;
console.log(`a is ${a}`);
If you need to write backticks (for markdown code block) within a template string, you can escape them with backslashes.
let code = "I am some code";
console.log(`\`\`\`${code}\`\`\``);