wechat4u
wechat4u copied to clipboard
关于UserName undefined
let ToUserName = bot.contacts['filehelper'].UserName, 在执行npm run core的时候提示UserName undefined,这个contacts['']单引号中的就是UserName了吧。 如果这样的话,用了bot.contacts['filehelper'].proto.UserName 可以了,是我node版本的问题吗
恩filehelper
就是UserName,这样写是为了展示出怎么去获取UserName
不过如果我直接按照上面的写bot.contacts['filehelper'].UserName会提示UserName没有定义。是什么原因?遇到过这种情况吗?
是 Cannot get UserName of undefined
吧?
是这样的