本文介紹了服務(wù)器問候語的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我嘗試制作服務(wù)器問候消息,但它甚至對(duì)我不起作用,我看到您可以嘗試使用 ch.name === 'name'
但我想要我的bot 將消息發(fā)送到具有特定 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}!`);
});
推薦答案
我認(rèn)為你需要在 Dev Portal 上開啟 Privileged Gateway Intents (https://discord.com/developers/applications)網(wǎng)關(guān)意圖
I believe you need to turn on Privileged Gateway Intents on the Dev Portal (https://discord.com/developers/applications) gateway intents on
這篇關(guān)于服務(wù)器問候語的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!