wechat4u icon indicating copy to clipboard operation
wechat4u copied to clipboard

关于UserName undefined

Open z8313568 opened this issue 8 years ago • 4 comments

let ToUserName = bot.contacts['filehelper'].UserName, 在执行npm run core的时候提示UserName undefined,这个contacts['']单引号中的就是UserName了吧。 如果这样的话,用了bot.contacts['filehelper'].proto.UserName 可以了,是我node版本的问题吗

z8313568 avatar Dec 11 '16 08:12 z8313568

filehelper就是UserName,这样写是为了展示出怎么去获取UserName

spacelan avatar Dec 12 '16 03:12 spacelan

不过如果我直接按照上面的写bot.contacts['filehelper'].UserName会提示UserName没有定义。是什么原因?遇到过这种情况吗?

z8313568 avatar Dec 12 '16 04:12 z8313568

Cannot get UserName of undefined 吧?

stonexer avatar Dec 12 '16 04:12 stonexer

是这样的

z8313568 avatar Dec 28 '16 14:12 z8313568