Server greetings(服务器问候语)
问题描述
我尝试制作服务器问候消息,但它甚至对我不起作用,我看到您可以尝试使用 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
这篇关于服务器问候语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:服务器问候语


基础教程推荐
- 如何添加到目前为止的天数? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01