服务器问候语 [英] Server greetings

查看:16
本文介绍了服务器问候语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试制作服务器问候消息,但它甚至对我不起作用,我看到您可以尝试使用 ch.name === 'name' 但我想要我的bot 将消息发送到具有特定 ID 的频道

I tried to make server greetings message but it doesn't even work for me, I saw that you can try to do this using ch.name === 'name' but I want my bot to send message to channel with specific id

client.on("guildMemberAdd", (member) => {
  const channel = member.guild.channels.cache.find((ch) => ch.id === `channel-id`);
  if (!channel) return;
  channel.send(`Welcome to the server, ${member}!`);
});

推荐答案

我认为你需要在 Dev Portal 上开启 Privileged Gateway Intents (https://discord.com/developers/applications)网关意图

I believe you need to turn on Privileged Gateway Intents on the Dev Portal (https://discord.com/developers/applications) gateway intents on

这篇关于服务器问候语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆