【发布时间】:2021-09-29 13:32:49
【问题描述】:
我一直在用 Python 为 Discord 编写代码,但我想切换到 JS,因为还有更多。我在格式化一行代码时遇到问题,我下载了这个音乐机器人来测试并熟悉 JS。它正在发送嵌入,但我想要文本。这是代码行:
if (this.textChannel) this.textChannel.send(f"Playing ???? Now playing ${this.current.info.title} - Right Now!");
我知道在 Python 中它会是这样的:
await ctx.send(f"Playing ???? Now playing ${this.current.info.title} - Right Now!").
f的等价物是什么?
【问题讨论】:
-
请不要将堆栈 sn-p 用于不可运行的代码。 Stack sn-ps 仅适用于可在浏览器上运行的 HTML、CSS 和 JavaScript 代码。请改用code block 格式化您的代码。
标签: javascript node.js discord discord.js