本文介紹了服務器問候語的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我嘗試制作服務器問候消息,但它甚至對我不起作用,我看到您可以嘗試使用 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
這篇關于服務器問候語的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!