juzibot / donut-tester

40 stars 4 forks source link

toContact() is not supported in Donut #72

Closed Charles-Wu-Chen closed 3 years ago

Charles-Wu-Chen commented 3 years ago

https://wechaty.github.io/wechaty/#Message+toContact This API is not support in Donut Puppet

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When are user share a contact name card, it would be handy to convert the message to contact and forward to others / other groups.

Describe the solution you'd like A clear and concise description of what you want to happen.

https://wechaty.github.io/wechaty/#Message+toContact, Implement it as official document described.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Way to simulate the unsupported API error:

.on('message', async message => {
    console.log(`message: ${JSON.stringify(message)}`)
    if (message.type() === Message.Type.Contact) {
      console.log(await message.toContact())
    }
  })

Error log

21:31:06 VERB Message toContact() 21:31:06 VERB PuppetHostie messageContact(424415824494391865) 21:31:06 ERR Config ########################### 21:31:06 ERR Config unhandledRejection: Error: 13 INTERNAL: Wechaty Puppet Unsupported API Error. Learn More At https://github.com/wechaty/wechaty-puppet/wiki/Compatibility at Object.exports.createStatusError (/Users/wuc/nodejsproject/wechaty-getting-started/node_modules/grpc/src/common.js:91:15) at Object.onReceiveStatus (/Users/wuc/nodejsproject/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1209:28) at InterceptingListener._callNext (/Users/wuc/nodejsproject/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:568:42) at InterceptingListener.onReceiveStatus (/Users/wuc/nodejsproject/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:618:8) at callback (/Users/wuc/nodejsproject/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:847:24) code: 13, metadata: Metadata { _internal_repr: {}, flags: 0 }, details: 'Wechaty Puppet Unsupported API Error. Learn More At https://github.com/wechaty/wechaty-puppet/wiki/Compatibility' }

[enhancement]

su-chang commented 3 years ago

It not supported now.