【问题标题】:Unresolved function or method send(), even if everything works ( WebStorm, discord.js )未解决的函数或方法 send(),即使一切正常(WebStorm,discord.js)
【发布时间】:2022-06-10 23:06:17
【问题描述】:

我正在尝试使用 Node.js 使用 WebStorm 创建一个机器人

这是我的代码:

const Discord = require( "discord.js" )
const client = new Discord.Client(
    {
        intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_MESSAGES"]
    }
)

client.login( "token" )

client.on( "ready", () => {
    console.log( "Discord bot is online." )
} )

client.on( "messageCreate", ( message ) => {
    if( message.content === "!ph" ){
        message.channel.send( "hello" )
    }
} )

即使一切正常,当我执行 message.channel.send() 时,如果发生“messageCreate”,ide 会给我这个警告:“未解析的函数或方法 send()”建议我创建发送方法。有谁知道如何修复它,因为他们不认识该方法,但无论如何运行它仍然有效?谢谢。

【问题讨论】:

标签: javascript node.js discord.js webstorm


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-11-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-27
相关资源
最近更新 更多