I am trying to have get my Discord bot send a message to another channel when when there is more than one item in the response, write a message to another channel (on the same server). This code is within an async function and returns the first item of the response.
Currently, this code is sending to the channel where the command originated. When I attempt things I ve found to send to another channel I get errors such as fetch not being found
or cache not being found
. What am I missing to get this to work?
if(response.length > 1)
{
let returnMessage = Items found: " + response.length;
for(let i = 0; i < response.length; i++)
{
let responseString = response[i].toString();
returnMessage += "
" + responseString.substring(responseString.indexOf( / , 10));
}
// send message to another channel here
message.channel.send("test message"); // this sends the message to the current channel.
}