Skip to content

Commit aee6be9

Browse files
committed
docs: update readme
1 parent cce7d5a commit aee6be9

File tree

1 file changed

+2
-161
lines changed

1 file changed

+2
-161
lines changed

README.md

+2-161
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Wechaty is used in many ChatBot projects by thousands of developers. If you want
4242

4343
Scan now, because other Wechaty Go developers want to talk with you too! (secret code: _go wechaty_)
4444

45-
## The World's Shortest Go ChatBot: 7 lines of Code
45+
## Usage
4646

4747
```go
4848
package main
@@ -68,168 +68,9 @@ func main() {
6868
}
6969
```
7070

71-
## Go Wechaty Developing Plan
72-
73-
We already have Wechaty in TypeScript, It will be not too hard to translate the TypeScript(TS) to Go because [wechaty](https://github.com/wechaty/wechaty) has only 3,000 lines of the TS code, they are well designed and de-coupled by the [wechaty-puppet](https://github.com/wechaty/wechaty-puppet/) abstraction. So after we have translated those 3,000 lines of TypeScript code, we will almost be done.
74-
75-
As we have already a ecosystem of Wechaty in TypeScript, so we will not have to implement everything in Go, especially, in the Feb 2020, we have finished the [@chatie/grpc](https://github.com/chatie/grpc) service abstracting module with the [wechaty-puppet-service](https://github.com/wechaty/wechaty-puppet-service) implmentation.
76-
77-
The following diagram shows out that we can reuse almost everything in TypeScript, and what we need to do is only the block located at the top right of the diagram: `Wechaty (Go)`.
78-
79-
```ascii
80-
+--------------------------+ +--------------------------+
81-
| | | |
82-
| Wechaty (TypeScript) | | Wechaty (Go) |
83-
| | | |
84-
+--------------------------+ +--------------------------+
85-
86-
+-------------------------------------------------------+
87-
| Wechaty Puppet Service |
88-
| |
89-
| (wechaty-puppet-service) |
90-
+-------------------------------------------------------+
91-
92-
+--------------------- @chatie/grpc ----------------------+
93-
94-
+-------------------------------------------------------+
95-
| Wechaty Puppet Abstract |
96-
| |
97-
| (wechaty-puppet) |
98-
+-------------------------------------------------------+
99-
100-
+--------------------------+ +--------------------------+
101-
| Pad Protocol | | Web Protocol |
102-
| | | |
103-
| wechaty-puppet-padplus | |(wechaty-puppet-puppeteer)|
104-
+--------------------------+ +--------------------------+
105-
+--------------------------+ +--------------------------+
106-
| Windows Protocol | | Mac Protocol |
107-
| | | |
108-
| (wechaty-puppet-windows) | | (wechaty-puppet-macpro) |
109-
+--------------------------+ +--------------------------+
110-
```
111-
112-
## Example: How to Translate TypeScript to Go
113-
114-
There's a 100 lines class named `Image` in charge of downloading the WeChat image to different sizes.
115-
116-
It is a great example for demonstrating how do we translate the TypeScript to Go in Wechaty Way:
117-
118-
### Image Class Source Code
119-
120-
- TypeScript: <https://github.com/wechaty/wechaty/blob/master/src/user/image.ts>
121-
- Go: <https://github.com/wechaty/go-wechaty/blob/master/src/wechaty/user/image.go>
122-
123-
If you are interested in the translation and want to look at how it works, it will be a good start from reading and comparing those two `Image` class files in TypeScript and Go at the same time.
124-
125-
## To-do List
126-
127-
- TS: TypeScript
128-
- SLOC: Source Lines Of Code
129-
130-
### Wechaty Internal Modules
131-
132-
1. [ ] Class Wechaty
133-
- TS SLOC(1160): <https://github.com/wechaty/wechaty/blob/master/src/wechaty.ts>
134-
- [ ] Code
135-
- [ ] Unit Tests
136-
- [ ] Documentation
137-
1. [ ] Class Contact
138-
- TS SLOC(804): <https://github.com/wechaty/wechaty/blob/master/src/user/contact.ts>
139-
- [ ] Code
140-
- [ ] Unit Tests
141-
- [ ] Documentation
142-
1. [ ] Class ContactSelf
143-
- TS SLOC(199): <https://github.com/wechaty/wechaty/blob/master/src/user/contact-self.ts>
144-
- [ ] Code
145-
- [ ] Unit Tests
146-
- [ ] Documentation
147-
1. [ ] Class Message
148-
- TS SLOC(1054): <https://github.com/wechaty/wechaty/blob/master/src/user/message.ts>
149-
- [ ] Code
150-
- [ ] Unit Tests
151-
- [ ] Documentation
152-
1. [ ] Class Room
153-
- TS SLOC(1194): <https://github.com/wechaty/wechaty/blob/master/src/user/room.ts>
154-
- [ ] Code
155-
- [ ] Unit Tests
156-
- [ ] Documentation
157-
1. [ ] Class Image
158-
- TS SLOC(60): <https://github.com/wechaty/wechaty/blob/master/src/user/image.ts>
159-
- [X] Code
160-
- [ ] Unit Tests
161-
- [ ] Documentation
162-
1. [ ] Class Accessory
163-
- TS SLOC(179): <https://github.com/wechaty/wechaty/blob/master/src/accessory.ts>
164-
- [ ] Code
165-
- [ ] Unit Tests
166-
- [ ] Documentation
167-
1. [ ] Class Config
168-
- TS SLOC(187): <https://github.com/wechaty/wechaty/blob/master/src/config.ts>
169-
- [ ] Code
170-
- [ ] Unit Tests
171-
- [ ] Documentation
172-
1. [ ] Class Favorite
173-
- TS SLOC(52): <https://github.com/wechaty/wechaty/blob/master/src/user/favorite.ts>
174-
- [ ] Code
175-
- [ ] Unit Tests
176-
- [ ] Documentation
177-
1. [ ] Class Friendship
178-
- TS SLOC(417): <https://github.com/wechaty/wechaty/blob/master/src/user/friendship.ts>
179-
- [ ] Code
180-
- [ ] Unit Tests
181-
- [ ] Documentation
182-
1. [ ] Class MiniProgram
183-
- TS SLOC(70): <https://github.com/wechaty/wechaty/blob/master/src/user/mini-program.ts>
184-
- [ ] Code
185-
- [ ] Unit Tests
186-
- [ ] Documentation
187-
1. [ ] Class RoomInvitation
188-
- TS SLOC(317): <https://github.com/wechaty/wechaty/blob/master/src/user/room-invitation.ts>
189-
- [ ] Code
190-
- [ ] Unit Tests
191-
- [ ] Documentation
192-
1. [ ] Class Tag
193-
- TS SLOC(190): <https://github.com/wechaty/wechaty/blob/master/src/user/tag.ts>
194-
- [ ] Code
195-
- [ ] Unit Tests
196-
- [ ] Documentation
197-
1. [ ] Class UrlLink
198-
- TS SLOC(107): <https://github.com/wechaty/wechaty/blob/master/src/user/url-link.ts>
199-
- [ ] Code
200-
- [ ] Unit Tests
201-
- [ ] Documentation
202-
203-
### Wechaty External Modules
204-
205-
1. [ ] Class FileBox
206-
- TS SLOC(638): <https://github.com/huan/file-box/blob/master/src/file-box.ts>
207-
- [ ] Code
208-
- [ ] Unit Tests
209-
- [ ] Documentation
210-
1. [ ] Class MemoryCard
211-
- TS SLOC(376): <https://github.com/huan/memory-card/blob/master/src/memory-card.ts>
212-
- [ ] Code
213-
- [ ] Unit Tests
214-
- [ ] Documentation
215-
1. [ ] Class WechatyPuppet
216-
- TS SLOC(1115): <https://github.com/wechaty/wechaty-puppet/blob/master/src/puppet.ts>
217-
- [ ] Code
218-
- [ ] Unit Tests
219-
- [ ] Documentation
220-
1. [ ] Class WechatyPuppetService
221-
- TS SLOC(909): <https://github.com/wechaty/wechaty-puppet-service/blob/master/src/client/puppet-service.ts>
222-
- [ ] Code
223-
- [ ] Unit Tests
224-
- [ ] Documentation
225-
226-
## Usage
227-
228-
WIP...
229-
23071
## Requirements
23172

232-
1. Go 1.14+
73+
1. Go 1.18+
23374

23475
## Install
23576

0 commit comments

Comments
 (0)