久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Bot 不會在加入時發送消息(djs)

Bot won#39;t messsage on join (djs)(Bot 不會在加入時發送消息(djs))
本文介紹了Bot 不會在加入時發送消息(djs)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我的機器人在加入時不發送消息.

client.on('guildMemberAdd', member => {常量 linkId = pool.createLink(client.id);const embed = new Discord.MessageEmbed().setTitle('reCAPTCHA 驗證').setDescription(`要訪問此服務器,您必須解決驗證碼.鏈接將在 15 分鐘后過期.
http://${domain == '' ? 'localhost:8050' : domain}/verify/${鏈接ID}`).setColor('藍色')成員.發送(嵌入)})

解決方案

鑒于您的代碼中沒有出現任何錯誤,我假設 guildMemberAdd 事件不會為您觸發一點也不.這可以通過在當前代碼中的 guildMemberAdd 事件處理程序中添加 console.log 語句并讓成員加入公會來快速確認.

我能想到會發生這種情況的唯一原因是 Discord API 相對較新的 intents 功能.您需要訂閱特定的意圖才能可靠地接收關聯事件.guildMemberAdd 位于

相關資源:
意圖和相關事件列表
有關意圖的一般信息

My bot doesn't send the message on join.

client.on('guildMemberAdd', member => {
    const linkId = pool.createLink(client.id);
    const embed = new Discord.MessageEmbed()
        .setTitle('reCAPTCHA Verification')
        .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.
http://${domain == '' ? 'localhost:8050' : domain}/verify/${linkId}`)
        .setColor('BLUE')
    member.send(embed)
})

解決方案

Given that you aren't getting any errors in your code, I'm assuming the guildMemberAdd event isn't triggering for you at all. This could be quickly confirmed by putting a console.log statement inside of your guildMemberAdd event handler in your current code, and having a member join the guild.

The only reason I can think of that this would occur, is the Discord API's relatively new intents feature. You need to subscribe to specific intents in order to reliably receive the affiliated events. guildMemberAdd is on the list of events that may require subscription to an intent.

Here's one possible fix you'll need to implement wherever you are defining client:

const intents = ["GUILDS", "GUILD_MEMBERS"];
const client = new Discord.Client({intents: intents, ws:{intents: intents}});

If you are already properly using intents, then I would recommend using console.log as aforementioned to ensure the guildMemberAdd event is triggering. If not, then this is the answer. Note that you must use discord.js v12.x.x to use intents, so if you're using an older version you'll need to update to fix your issue.

You may also need to enable the below setting for your bot on its discord developers page, as I think guildMemberAdd is part of a privileged intent:

Relevant resources:
List of intents and associated events
General info about intents

這篇關于Bot 不會在加入時發送消息(djs)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 色综合天天天天做夜夜夜夜做 | 精品二区 | 久草福利 | 国产三级| 久久精品一区 | 91精品国产欧美一区二区成人 | 亚洲中国字幕 | 国产精品久久久久久久岛一牛影视 | 免费在线看黄视频 | 成人欧美一区二区三区 | 色婷婷精品 | 99精品欧美一区二区三区 | 玖玖精品 | 一级做a| 国产99久久精品一区二区永久免费 | 国产成人精品免费视频大全最热 | 成人国产精品久久久 | 精品久久一区 | 日韩精品一区二区三区在线播放 | 中文在线视频 | 国产一区二区三区四区 | 91免费看片 | 成人免费视频一区二区 | 国产精品极品美女在线观看免费 | 国产精品777一区二区 | 人人鲁人人莫人人爱精品 | 天堂在线www| 久久久精品 | 中文字幕1区2区3区 日韩在线视频免费观看 | 亚洲成人精品久久久 | 在线免费看毛片 | 精品国产青草久久久久福利 | 亚洲一区二区久久久 | 精品欧美一区二区三区 | 精品少妇一区二区三区在线播放 | 日韩中出 | 欧美成人免费在线视频 | 中文在线一区 | 91网视频 | 成人精品视频在线观看 | 一区二区三区高清 |