@@ -11,6 +11,100 @@ sidebar_label: Paimon
11
11
- Privacy Policy: To-be-added
12
12
- Service Level Agreement (SLA): To-be-added
13
13
14
+ ## Simple and Effective
15
+
16
+ - Paimon service is so simple.It don't need Token Gateway(Docker) and don't need the 3rd party library.
17
+ - Paimon的服务很简单,不需要token网关也不需要第三方的库,原生支持Wechaty。
18
+
19
+ package.json
20
+
21
+ ``` json
22
+ {
23
+ "name" : " wechaty-puppet-paimon" ,
24
+ "version" : " 0.0.1" ,
25
+ "description" : " Demo for paimon" ,
26
+ "author" : " you" ,
27
+ "license" : " Apache-2.0" ,
28
+ "dependencies" : {
29
+ "qrcode-terminal" : " ^0.12.0" ,
30
+ "wechaty" : " ^1.0"
31
+ }
32
+ }
33
+
34
+ ```
35
+
36
+ bot.js
37
+
38
+ ``` js
39
+ const {
40
+ log ,
41
+ ScanStatus ,
42
+ WechatyBuilder ,
43
+ } = require (' wechaty' )
44
+
45
+ const bot = WechatyBuilder .build ({
46
+ name: ' ding-dong-bot' ,
47
+ puppet: ' wechaty-puppet-service' ,
48
+ puppetOptions: {
49
+ tls: {
50
+ disable: true
51
+ },
52
+ token: " puppet_paimon_YOUR_TOKEN" // !!!!! Please change it !!!!!
53
+ }
54
+ })
55
+
56
+ function onScan (qrcode , status ) {
57
+ if (status === ScanStatus .Waiting && qrcode) {
58
+ const qrcodeImageUrl = [
59
+ ' https://wechaty.js.org/qrcode/' ,
60
+ encodeURIComponent (qrcode),
61
+ ].join (' ' )
62
+
63
+ log .info (' StarterBot' , ' onScan: %s(%s) - %s' , ScanStatus[status], status, qrcodeImageUrl)
64
+ } else {
65
+ log .info (' StarterBot' , ' onScan: %s(%s)' , ScanStatus[status], status)
66
+ }
67
+ }
68
+
69
+ function onLogin (user ) {
70
+ log .info (' StarterBot' , ' %s login' , user);
71
+ }
72
+
73
+ function onLogout (user ) {
74
+ log .info (' StarterBot' , ' %s logout' , user);
75
+ }
76
+
77
+ function onMessage (msg ) {
78
+ console .log (msg)
79
+ if (msg .self ()) return ;
80
+ }
81
+
82
+ bot .on (' scan' , onScan)
83
+ bot .on (' login' , onLogin)
84
+ bot .on (' logout' , onLogout)
85
+ bot .on (' message' , onMessage)
86
+
87
+ bot .start ()
88
+ .then (() => {
89
+ log .info (' StarterBot' , ' Starter Bot Started.' );
90
+ })
91
+ .catch (e => {
92
+ log .error (' StarterBot' , e);
93
+ })
94
+ ```
95
+
96
+ ``` bash
97
+ >> npm i
98
+ >> node bot.js
99
+ ```
100
+
101
+ ## Paimon supports multi languages
102
+
103
+ NO token gateway required.(不需要Token网关直接使用)
104
+
105
+ - [ Python] ( https://wechaty.readthedocs.io/zh_CN/latest/introduction/use-paimon-protocol/ )
106
+ - [ GO] ( https://github.com/wechaty/go-wechaty-getting-started )
107
+
14
108
## How to buy
15
109
16
110
[ Get a FREE trail token for 7 days.] ( http://120.55.60.194/ )
0 commit comments