-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add doc #1458
Add doc #1458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Please remove the changes of file docs/index.md
, and follow my reviews.
src/user/contact.ts
Outdated
@@ -479,8 +509,12 @@ export class Contact extends Accessory implements Sayable { | |||
|
|||
/** | |||
* Contact gender | |||
* > Tips: ContactGender is enum here. </br> | |||
* - ContactGender.Unknown = 0</br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all numbers in the ENUM type.
ContactGender.Unknown
is enough, the user should care about the number value about it, and also should never use the magic number.
src/user/friendship.ts
Outdated
* @example | ||
* const bot = new Wechaty() | ||
* bot.on('friendship', async friendship => { | ||
* console.log(`received friend event from ${friendship.contact().name()}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the expression shorter, which is better for readability.
const contact = friendship.contact()
const name = contact.name()
console.log(`received friend event from ${name}`)
src/user/friendship.ts
Outdated
/** | ||
* Return the Friendship Type | ||
* > Tips: FriendshipType is enum here. </br> | ||
* - FriendshipType.Unknown = 0 </br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of all magic numbers
* # 3. send Contact | ||
* | ||
* if (/^lijiarui$/i.test(m.text())) { | ||
* const contactCard = await bot.Contact.find({name: 'lijiarui'}) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/user/message.ts
Outdated
/** | ||
* Get the type from the message. | ||
* > Tips: MessageType is Enum here. </br> | ||
* - MessageType.Unknown = 0, </br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of all magic numbers.
* @param {string} [text] If set this para, it will change room announce. | ||
* @returns {(Promise<void | string>)} | ||
* | ||
* @example <caption>When you say anything in a room, it will get room announce. </caption> |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/user/room.ts
Outdated
* @deprecated use sync() instead | ||
* @returns {Promise<void>} | ||
* @description | ||
* Force reload data for Room, use {@link Room#sync} instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use @ignore
here.
So does sync()
because they are not the public API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we do not make this API public?
* @example | ||
* import { Wechaty } from 'wechaty' | ||
* See more: | ||
* - [What is a Puppet in Wechaty](https://github.com/Chatie/wechaty-getting-started/wiki/FAQ-EN#31-what-is-a-puppet-in-wechaty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use Wiki at wechaty-getting-started
repository, we have to keep that repo as simple as possible.
I'll disable the wiki of it later, please move the FAQ to the Wiki at Wechaty Repository.
English version should be named with FAQ
, and the ZH version you can name it.
src/wechaty.ts
Outdated
* | ||
* # 2 TypeScript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the TypeScript
part, because it has no typing at all, it's just ES6.
src/wechaty.ts
Outdated
* @example | ||
* const bot = new Wechaty() | ||
* await bot.start() | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// after logged in
Please put the following introduction to the doc as a start point. Message.age()Returns the message age in seconds. For example, the message is sent at time 8:43:01, and when we received it in Wechaty, the time is 8:43:15, then the age() will return 8:43:15 - 8:43:01 = 14 (seconds) Message.toFileBox()Extract the Media File from the Message, and put it into the FileBox. Room.qrcode()Get QR Code of the Room from the room, which can be used as scan and join the room. |
Did you follow all my reviews? If not, which one had been skipped, and why? Please leave message by replying the PR and let me know what you did in your lastest commits. |
Yes, I follow all your reviews and change all as you request besides the following 3 things:
|
No, you missed some of the reviews, like |
Yes, you are right. I agree with you. After we finish the 3 discussions, I will remove the |
No need to discuss anymore. Please just remove that file and I'll merge it. |
I remove that file and you can merge it. |
Thank you very much for the great JSDoc! |
Add js-doc for new wechaty
see wechaty/getting-started#23
The full doc can be seen: https://botorange.github.io/wechaty-doc/#/
Still, have the following functions need to be add, may need @zixia do:
Still have the following small bug due to docsify:
definition
submenuPuppetName
should in wechaty file but it was build in message file