简体   繁体   English

TypeError [ERR_INVALID_ARG_TYPE]:“侦听器”参数的类型必须为 function。接收未定义

[英]TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type function. Received undefined

At Object. (C:\Users\Hades\Downloads\Jaxxy\src\bot.js:51:8)在 Object。(C:\Users\Hades\Downloads\Jaxxy\src\bot.js:51:8)

My code for the specified command is我指定命令的代码是

client.on('guildMemberAdd'), member => {
  const channel = member.guild.channels.cache.find(channel=> channel.name === "welcome");
  if(!channel) return;
  channel.send(`Welcome to Hades's Tavern,$(member), make sure to read the rules in #rules!`)

};

I'm on discord.js v12?我在 discord.js v12 上? Anyone has any clue?有人有任何线索吗?

The closing parenthesis has to be after the arrow function's body:右括号必须在箭头函数的主体之后:

client.on('guildMemberAdd', member => {
    const channel = member.guild.channels.cache.find(channel => channel.name === "welcome");
    if (!channel) return;
    channel.send(`Welcome to Hades's Tavern,$(member), make sure to read the rules in #rules!`)

});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TypeError [ERR_INVALID_ARG_TYPE]:“原始”参数的类型必须为 Function。接收到的类型未定义 - TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type Function. Received type undefined TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。 收到未定义和代码:'ERR_INVALID_ARG_TYPE' - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined and code: 'ERR_INVALID_ARG_TYPE' 图片上传错误:TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。 接收类型未定义 - Image Upload Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined 类型错误 [ERR_INVALID_ARG_TYPE]:“文件”参数必须是字符串类型。 接收类型对象 - TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。 收到 Object 的实例 - TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received an instance of Object 等待 dTypeError [ERR_INVALID_ARG_TYPE]:“id”参数必须是字符串类型。 收到未定义 - Waiting for the dTypeError [ERR_INVALID_ARG_TYPE]: The “id” argument must be of type string. Received undefined TypeError [ERR_INVALID_ARG_TYPE]:“原始”参数必须是 function 类型 - TypeError [ERR_INVALID_ARG_TYPE]: The “original” argument must be of type function 接收 UnhandledPromiseRejectionWarning:TypeError [ERR_INVALID_ARG_TYPE]:“原始”参数必须是 function 类型 - Receiving UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function Webpack 类型错误'TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。 接收类型布尔值(真)' - Webpack type error 'TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type boolean (true)' TypeError [ERR_INVALID_ARG_TYPE]:“块”参数必须是字符串或缓冲区类型之一。 接收型号 - TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or Buffer. Received type number
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM