Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment: Example code error #1746

Closed
linyimin0812 opened this issue Apr 19, 2019 · 1 comment · Fixed by #1749
Closed

Comment: Example code error #1746

linyimin0812 opened this issue Apr 19, 2019 · 1 comment · Fixed by #1749
Labels

Comments

@linyimin0812
Copy link
Contributor

1. Versions

  • What is your wechaty version?
    Answer:

mater branch

2. Describe the bug

Comment Error:

In user/contact-self.ts file, the example code of name.

/**
   * Change bot name
   *
   * @param name The new name that the bot will change to
   *
   * @example
   * bot.on('login', async user => {
   *   console.log(`user ${user} login`)
   *   const oldName = user.name()
   *   try {
   *     await user.setName(`${oldName}-${new Date().getTime()}`)
   *   } catch (e) {
   *     console.error('change name failed', e)
   *   }
   * })
   */

We should use the name method, not the setName

This was referenced Apr 19, 2019
@huan
Copy link
Member

huan commented Apr 20, 2019

Thanks!

@huan huan added the bug label Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants