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

Puppet padchat #1245

Merged
merged 14 commits into from
May 29, 2018
Merged

Puppet padchat #1245

merged 14 commits into from
May 29, 2018

Conversation

lijiarui
Copy link
Member

@lijiarui lijiarui commented May 29, 2018

1. Create a padchat-schemas.ts to define all data structure.

  • PadchatContactRawPayload
  • PadchatMessageRawPayload
  • PadchatRoomRawPayload
  • PadchatMessageType

Import these structure to puppet-padchat.ts

2. Mock data in the following functions as the define data structure above:

  • function contactRawPayload()
  • function messageRawPayload()
  • function roomRawPayload()

3. Build the first connection:

  • function start(): set connection with websocket server
  • save wechat user profile to file: save 62(in ipad) data to profile.json

4. Implement the following payload:

  • function contactRawPayload()
  • funciont contactRawPayloadParser()
  • function messageRawPayload()
  • function messageRawPayloadParser()

5. Implement message send

  • function messageSendText()

6. Implement all ready function

  • function ready()

7. Run ding-dong-bot successfully

  • run WECHATY_PUPPET=padchat npm run demo

8. Implement more payload

  • function roomRawPayload()
  • function roomRawPayloadParser()

8. Implement more functions:

  • function logout()
  • function messageSendFile()
    Using packBase64 to send base64 file
public async contactAvatar(contactId: string): Promise<FileBox> {
    log.verbose('PuppetPadchat', 'contactAvatar(%s)', contactId)

    const WECHATY_ICON_PNG = path.resolve('../../docs/images/wechaty-icon.png')
    return FileBox.packBase64(WECHATY_ICON_PNG)
  }
  • function messageForward()

10. Implement detailed functions

  • function contactAlias()
  • function contactFindAll()
  • functjion contactAvatar()
  • function roomFindAll()
  • function roomDel()
  • function roomAdd()
  • function roomTopic()
  • function roomCreate()
  • function roomQuit()

11. Make the connection stable and monitorable

  • initWatchdog : Detect the alive connection with websocket server

12. Others

  • friendRequestSend
  • friendRequestAccept

13. More

  • this.state.off()
  • function stop()

@huan huan merged commit 6242254 into wechaty:master May 29, 2018
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

Successfully merging this pull request may close these issues.

2 participants