3 回答
TA贡献1906条经验 获得超10个赞
有一种更简单的方法来做你想做的事情。复制该频道的 ID,然后像这样在您的代码中获取该频道:
bot.on('guildMemberAdd', (member) => { const channel = member.guild.channels.cache.get('channel-id'); channel.send('Welcome'); });
TA贡献1860条经验 获得超9个赞
也许试试这个?:
client.on('guildMemberAdd', member => {
let welChannel = member.guild.channels.cache.find(ch => ch.name === "・𝘪𝘮𝘴𝘨")
const exampleEmbed = new Discord.MessageEmbed()
.setColor('RANDOM')
.setTitle(`Welcome to lovell <$, **${member.user.username}**`)
.setImage('https://images-ext-1.discordapp.net/external/Gy-micqoX7qrlivnytbmFgfTbxPx_CSvgChFLE3qC7g/https/media.discordapp.net/attachments/755425128635957348/758525058934767617/HaxzUWa46sK5CXKzIR.gif')
.setFooter('Boost Us');
welChannel.send(exampleEmbed).catch(e => console.error(`Welcome Error in ${message.guild.name}`) | message.channel.send("__**ERROR:**__ ** Someone joined the server but I was unable to catch it.**"));
})
如果这不起作用,则可能是机器人找不到频道・𝘪𝘮𝘴𝘨。
添加回答
举报