小编use*_*601的帖子

message.content 在 Discord.js 中没有任何值

在discord v14中,我尝试使用该messageCreate事件,但是,当用户在discord中键入消息后,message.content没有任何数据,如下所示:

Message {
  channelId: '998889338475655188',
  guildId: '948995127148425246',
  id: '998925735668498433',
  createdTimestamp: 1658232854526,
  type: 0,
  system: false,
  content: '',
  author: User 
Run Code Online (Sandbox Code Playgroud)

我尝试四处搜索,但找不到任何解决该问题的方法,我使用的与不和谐相关的代码是:

import { Client, GatewayIntentBits, Partials } from "discord.js";

const bot = new Client({
  'intents': [
    GatewayIntentBits.DirectMessages,
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildBans,
    GatewayIntentBits.GuildMessages
  ],
  'partials': [Partials.Channel]
});

bot.on('messageCreate', async (message) => {
  console.log(message);
});

bot.login(process.env.token1)
Run Code Online (Sandbox Code Playgroud)

有谁知道新更新出了什么问题或需要更改什么?

javascript node.js discord discord.js

22
推荐指数
1
解决办法
3万
查看次数

标签 统计

discord ×1

discord.js ×1

javascript ×1

node.js ×1