I am trying to display the IDs from Array 1 next to the corresponding IDs from Array 2.
The two arrays I am working with are called memberIDs
and rolesIDs
. The memberIDs
array contains the member IDs in a voice channel, while the roleIDs
array includes various role IDs.
To achieve this, I wrote the following code:
message.channel.send(memberIDs.map(element => "<@" + element + "> -> " + rolesIG.map(element => "<@" + element + ">" ).join()).join("\n"));
Unfortunately, the output is not as desired. It displays each member separately but lists all entries from roleIDs
together like this:
<@memberID1> -> <@&roleID1> <@&roleID2> <@&roleID3>
<@memberID2> -> <@&roleID1> <@&roleID2> <@&roleID3>
I want it to be displayed like this:
<@memberID1> -> <@roleID1>
<@memberID2> -> <@roleID2>
Any help would be greatly appreciated.