Have the Discord Bot link another Channel

Viewed 4097

I have a Discord bot and I want it to direct someone to a different channel if they use the trigger word(s). I know I'm probably missing a line or two of code to do it.

bot.on("message", message => {
    if(message.content.toLowerCase().indexOf('lists') > -1) {
        message.channel.send(`Please visit #bt-updates for information on the current list information!`);
    }
});
3 Answers

Based on your response to HolyDragon, it seems you're looking for how to give the "blue link" for the channel in your response?

If so, you need the channel id for #bt-updates, and to return it as

bot.on("message", message => {
  if(message.content.toLowerCase() === 'lists') {
    message.channel.send(`Please visit <#${id}> for information on the current list information!`);
  }
});

let room1 = message.channel.guild.channels.find('id', 'ChannelID'); message.channel.send(Please visit ${room1} for information on the current list information!); }

Try using === instead of indexOf().

bot.on("message", message => {
    if(message.content.toLowerCase() === 'lists') {
        message.channel.send(`Please visit #bt-updates for information on the current list information!`);
    }
});

Official example for Ping.

Related