【发布时间】:2020-08-25 16:38:55
【问题描述】:
我正在尝试让 api 返回几个数组,并让我的代码将每个数组项附加到新的 Discord 嵌入中。到目前为止,我的代码是:
cleanedSearchArray.forEach( lyricResult => lyricSearchEmbed.addField('\u200B' + lyricResult, 'by ' + cleanedSearchArtistArray.forEach()));
我正在尝试让我的嵌入输出:
song0
by artist0
song1
by artist1
song2
by artist2
但相反,我得到:
song0
by function forEach() { [native code] }
song1
by function forEach() { [native code] }
song2
by function forEach() { [native code] }
有什么方法可以得到想要的输出?
顺便说一句,cleanedSearchArray 包括 [song0、song1、song2],cleanedSearchArtistArray 包括 [artist0、artist1、artist2]
【问题讨论】:
标签: node.js discord.js