mioki 0.1.0-beta.8 → 0.1.1
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/package.json +9 -2
- package/.node-version +0 -1
- package/src/index.ts +0 -40
- package/src/logger.ts +0 -16
- package/tsconfig.json +0 -3
- package/tsdown.config.ts +0 -12
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mioki",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"description": "A simple NapCat OneBot v11 framework.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"onebot",
|
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
"framework",
|
|
10
10
|
"bot"
|
|
11
11
|
],
|
|
12
|
+
"homepage": "https://github.com/vikiboss/mioki#readme",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/vikiboss/mioki/issues"
|
|
18
|
+
},
|
|
12
19
|
"repository": {
|
|
13
20
|
"type": "git",
|
|
14
21
|
"url": "git+https://github.com/vikiboss/mioki.git",
|
|
@@ -27,7 +34,7 @@
|
|
|
27
34
|
"dependencies": {
|
|
28
35
|
"pino": "^10.1.0",
|
|
29
36
|
"pino-pretty": "^13.1.3",
|
|
30
|
-
"napcat-sdk": "0.1.
|
|
37
|
+
"napcat-sdk": "0.1.1"
|
|
31
38
|
},
|
|
32
39
|
"devDependencies": {
|
|
33
40
|
"tsdown": "^0.18.0",
|
package/.node-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
24.11.1
|
package/src/index.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// import process from 'node:process'
|
|
2
|
-
import { NapCat } from 'napcat-sdk'
|
|
3
|
-
|
|
4
|
-
export async function test() {
|
|
5
|
-
const napcat = new NapCat({
|
|
6
|
-
// token for local ws test, it's safe to expose in public
|
|
7
|
-
token: 'cdc93b212524c0c0a0a162f1edec347a',
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
napcat.on('ws.open', async () => {
|
|
11
|
-
console.log('ws opened')
|
|
12
|
-
const group = await napcat.pickGroup(608391254)
|
|
13
|
-
console.log('group info:', group)
|
|
14
|
-
|
|
15
|
-
const friend = await napcat.pickFriend(1141284758)
|
|
16
|
-
console.log('friend info:', friend)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
napcat.on('message.group', async (e) => {
|
|
20
|
-
console.log('[message]', JSON.stringify(e))
|
|
21
|
-
|
|
22
|
-
if (e.raw_message === 'ping') {
|
|
23
|
-
return await e.reply('pong', true)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (e.raw_message === 'reaction') {
|
|
27
|
-
return e.addReaction('66')
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (e.raw_message === 'recall') {
|
|
31
|
-
return await e.recall()
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (e.raw_message === 'hi') {
|
|
35
|
-
await e.reply(napcat.segment.face(14))
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
await napcat.bootstrap()
|
|
40
|
-
}
|
package/src/logger.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import createPino from 'pino'
|
|
2
|
-
|
|
3
|
-
import type { Logger } from 'napcat-sdk'
|
|
4
|
-
|
|
5
|
-
const pino = createPino({
|
|
6
|
-
// level: 'trace',
|
|
7
|
-
name: 'mioki',
|
|
8
|
-
transport: {
|
|
9
|
-
target: 'pino-pretty',
|
|
10
|
-
options: {
|
|
11
|
-
colorize: true,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export const MIOKI_LOGGER: Logger = pino
|
package/tsconfig.json
DELETED
package/tsdown.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsdown'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: ['./src/index.ts'],
|
|
5
|
-
dts: true,
|
|
6
|
-
sourcemap: true,
|
|
7
|
-
target: 'node24',
|
|
8
|
-
treeshake: true,
|
|
9
|
-
tsconfig: './tsconfig.json',
|
|
10
|
-
format: ['cjs', 'esm'],
|
|
11
|
-
failOnWarn: false,
|
|
12
|
-
})
|