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

wechaty类 #20

Closed
5 of 6 tasks
windmemory opened this issue Jul 12, 2018 · 4 comments
Closed
5 of 6 tasks

wechaty类 #20

windmemory opened this issue Jul 12, 2018 · 4 comments
Assignees

Comments

@windmemory
Copy link
Member

windmemory commented Jul 12, 2018

  • If you want to know how to send message, see Message If you want to knwo how to get contact, see Contact
    should be two lines

  • wechaty.on(event, listener) section, Returns: Wechaty -- this is for chain.
    better to have an example to show how to chain.

  • Example code section's title should explains a little what this example does, or at least tell the user that is the example for.

  • wechaty.init() is deprecated, we should tell user which one to replace this. Maybe add use start instead.

  • wechaty.start() Maybe we could reminds the user that most of the bot operation needs to be triggered after start() is done

  • instance example is still using init(), should be replaced by start()

lijiarui added a commit that referenced this issue Jul 12, 2018
@lijiarui
Copy link
Member

fix

lijiarui added a commit to lijiarui/wechaty that referenced this issue Jul 12, 2018
@lijiarui lijiarui reopened this Jul 12, 2018
@lijiarui lijiarui self-assigned this Jul 12, 2018
@lijiarui
Copy link
Member

Example code section's title should explains a little what this example does, or at least tell the user that is the example for.

Which Example code and add what content

lijiarui added a commit that referenced this issue Jul 12, 2018
lijiarui added a commit to lijiarui/wechaty that referenced this issue Jul 12, 2018
@lijiarui lijiarui assigned windmemory and unassigned lijiarui Jul 12, 2018
@windmemory
Copy link
Member Author

Return the type of: Wechaty - this is for chaining, see advanced [chaining usage](link-to-chaining-page)

Page in somewhere, maybe FAQ or Other

Method chaining, also known as named parameter idiom, is a common syntax for invoking multiple method calls in object-oriented programming languages. Each method returns an object, allowing the calls to be chained together in a single statement without requiring variables to store the intermediate results. [More info](https://en.wikipedia.org/wiki/Method_chaining)

`Wechaty` class support method chaining, you could write code like this:
``
const { Wechaty } = require('wechaty')
const bot = new Wechaty()
.on('scan', (qrcode, status) =>  {})
.on('login', user => {})
.on('message', message => {})
.start()
``

@lijiarui
Copy link
Member

@windmemory done

huan pushed a commit to wechaty/wechaty that referenced this issue Jul 12, 2018
* init

* add wechaty main doc

* fix wechaty comment

* add contact doc

* add contact more comment

* add room docs

* add message doc

* add friendship doc

* change as request

* change room find function typo

* add request doc

* remove index.md

* removed change of docs/index

* fix typo

* fix message typo

* juzibot/wechaty-doc#19

* juzibot/wechaty-doc#20

* wechaty.init should use start instead

* juzibot/wechaty-doc#20

* https://github.com/qhduan/wechaty-doc/issues/20\#issuecomment-404408822

* juzibot/wechaty-doc#23

* fix contact enum things in juzibot/wechaty-doc#22

* change friendship send function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants