当有人加入服务器时,我的不和谐机器人没有发送欢迎信息


bot.on('guildMemberAdd', async member => {
const sohbet = await client.channels.cache.find(x => x.id == "801461330674057247")
client.channels.get("801461330674057247").send("testing")
})

这是我的代码

尝试全局设置ChannelText,以便它可以在脚本/应用程序中的任何地方访问。

var ChannelText = undefined;
bot.on('ready', async () => {
ChannelText = bot.channels.cache.get("801461330674057247");
ChannelText.SendMessage("test test test!");
});
bot.on('guildMemberAdd', async () => {
ChannelText.SendMessage("OH WOW IT'S WORKING!!! BUT CAN I GET THE USERNAME NOW?");
});

相关内容

最新更新