@itsliaaa/starcore 0.0.0-alpha.14 → 0.0.0-alpha.16.463433
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/lib/adapter/auth.js +1 -1
- package/lib/adapter/database.js +1 -1
- package/lib/adapter/index.js +1 -1
- package/lib/constant/errors.js +1 -1
- package/lib/constant/index.js +1 -1
- package/lib/core/client.js +1 -1
- package/lib/core/extend.js +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/serialize.js +1 -1
- package/lib/socket/chat.js +1 -1
- package/lib/socket/index.js +1 -1
- package/lib/socket/message.js +1 -1
- package/lib/socket/newsletter.js +1 -1
- package/lib/socket/relay.js +1 -1
- package/lib/socket/username.js +1 -1
- package/lib/utility/functions.js +1 -1
- package/lib/utility/index.js +1 -1
- package/lib/utility/link-preview.js +1 -1
- package/lib/utility/media.js +1 -1
- package/lib/utility/message.js +1 -1
- package/lib/utility/request.js +1 -1
- package/lib/utility/scraper.js +1 -1
- package/lib/utility/store.js +1 -1
- package/lib/utility/watcher.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -159,6 +159,18 @@ const client = new Client({
|
|
|
159
159
|
}
|
|
160
160
|
})
|
|
161
161
|
|
|
162
|
+
client.on('connect', (ctx) => {
|
|
163
|
+
switch (ctx.type) {
|
|
164
|
+
case 'pairing':
|
|
165
|
+
console.log(ctx.prettyCode ?? ctx.asciiQr)
|
|
166
|
+
break
|
|
167
|
+
|
|
168
|
+
case 'close':
|
|
169
|
+
console.error(ctx.reason)
|
|
170
|
+
break
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
|
|
162
174
|
client.on('message', (ctx) => {
|
|
163
175
|
if (ctx.body === 'hello') {
|
|
164
176
|
ctx.m.reply('👋 Hello there!')
|
|
@@ -267,6 +279,8 @@ setInterval(async () => {
|
|
|
267
279
|
### 📡 Events Reference
|
|
268
280
|
|
|
269
281
|
```javascript
|
|
282
|
+
client.on('prepare', console.log)
|
|
283
|
+
client.on('connect', console.log)
|
|
270
284
|
client.on('ready', console.log)
|
|
271
285
|
client.on('message', console.log)
|
|
272
286
|
client.on('message.edit', console.log)
|