我的机器人没有阅读 Discord 聊天内容。我希望它阅读聊天记录,如果它找到某些单词,它会给出一定的响应。这是我当前的消息事件代码。这是我的第一个 JavaScript 项目,我刚刚开始学习它,所以请把它拆开,以便我可以学得更快:)
目前我可以让机器人加载到不和谐中。我可以使用 .node 打开它,但无法让它使用 message.content 读取消息。
const Discord = require("discord.js");
const client = new Discord.Client({ intents: ["GUILD_MESSAGES", "DIRECT_MESSAGES"] });
var name = "Poker Bot";
var usersHand
let firstCardValue
let secondCardValue
let firstCardSuit
let secondCardSuit
//starts the bot and sets activity to a funny quote. it also will give a command prompt notification that the
// bot is online
client.on("ready", () => {
console.log(`Bot is online: ${name} !`);
client.user.setActivity('Burning The Fucking Casino Down');
});
//check discord chat …Run Code Online (Sandbox Code Playgroud)