让Discord Bot链接另一个频道



我有一个Discord机器人,如果有人使用触发词,我希望它能将他们引导到另一个频道。我知道我可能遗漏了一两行代码。

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!`);
}
});

根据您对HolyDragon的回应,您似乎在寻找如何在回应中为频道提供"蓝色链接"?

如果是这样,您需要#bt更新的通道id,并将其作为返回

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

尝试使用===而不是indexOf()

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

平的官方榜样。

let room1=message.channe.guild.channels.find('id','ChannelID'(消息.信道.发送(Please visit ${room1} for information on the current list information!(;}

最新更新