mioki 0.1.0 → 0.1.2
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/dist/index.cjs +2 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -4
- package/readme.md +6 -0
- 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/dist/index.cjs
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
let napcat_sdk = require("napcat-sdk");
|
|
2
1
|
|
|
3
2
|
//#region src/index.ts
|
|
4
|
-
|
|
5
|
-
const napcat = new napcat_sdk.NapCat({ token: "cdc93b212524c0c0a0a162f1edec347a" });
|
|
6
|
-
napcat.on("ws.open", async () => {
|
|
7
|
-
console.log("ws opened");
|
|
8
|
-
const group = await napcat.pickGroup(608391254);
|
|
9
|
-
console.log("group info:", group);
|
|
10
|
-
const friend = await napcat.pickFriend(1141284758);
|
|
11
|
-
console.log("friend info:", friend);
|
|
12
|
-
});
|
|
13
|
-
napcat.on("message.group", async (e) => {
|
|
14
|
-
console.log("[message]", JSON.stringify(e));
|
|
15
|
-
if (e.raw_message === "ping") return await e.reply("pong", true);
|
|
16
|
-
if (e.raw_message === "reaction") return e.addReaction("66");
|
|
17
|
-
if (e.raw_message === "recall") return await e.recall();
|
|
18
|
-
if (e.raw_message === "hi") await e.reply(napcat.segment.face(14));
|
|
19
|
-
});
|
|
20
|
-
await napcat.bootstrap();
|
|
21
|
-
}
|
|
3
|
+
function start() {}
|
|
22
4
|
|
|
23
5
|
//#endregion
|
|
24
|
-
exports.
|
|
6
|
+
exports.start = start;
|
|
25
7
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export function start(): void {}\n"],"mappings":";;AAAA,SAAgB,QAAc"}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import { NapCat } from "napcat-sdk";
|
|
2
|
-
|
|
3
1
|
//#region src/index.ts
|
|
4
|
-
|
|
5
|
-
const napcat = new NapCat({ token: "cdc93b212524c0c0a0a162f1edec347a" });
|
|
6
|
-
napcat.on("ws.open", async () => {
|
|
7
|
-
console.log("ws opened");
|
|
8
|
-
const group = await napcat.pickGroup(608391254);
|
|
9
|
-
console.log("group info:", group);
|
|
10
|
-
const friend = await napcat.pickFriend(1141284758);
|
|
11
|
-
console.log("friend info:", friend);
|
|
12
|
-
});
|
|
13
|
-
napcat.on("message.group", async (e) => {
|
|
14
|
-
console.log("[message]", JSON.stringify(e));
|
|
15
|
-
if (e.raw_message === "ping") return await e.reply("pong", true);
|
|
16
|
-
if (e.raw_message === "reaction") return e.addReaction("66");
|
|
17
|
-
if (e.raw_message === "recall") return await e.recall();
|
|
18
|
-
if (e.raw_message === "hi") await e.reply(napcat.segment.face(14));
|
|
19
|
-
});
|
|
20
|
-
await napcat.bootstrap();
|
|
21
|
-
}
|
|
2
|
+
function start() {}
|
|
22
3
|
|
|
23
4
|
//#endregion
|
|
24
|
-
export {
|
|
5
|
+
export { start };
|
|
25
6
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export function start(): void {}\n"],"mappings":";AAAA,SAAgB,QAAc"}
|
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.2",
|
|
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",
|
|
@@ -17,8 +24,7 @@
|
|
|
17
24
|
"exports": {
|
|
18
25
|
".": {
|
|
19
26
|
"require": "./dist/index.cjs",
|
|
20
|
-
"import": "./dist/index.mjs"
|
|
21
|
-
"types": "./dist/index.d.ts"
|
|
27
|
+
"import": "./dist/index.mjs"
|
|
22
28
|
},
|
|
23
29
|
"./package.json": "./package.json"
|
|
24
30
|
},
|
|
@@ -27,7 +33,7 @@
|
|
|
27
33
|
"dependencies": {
|
|
28
34
|
"pino": "^10.1.0",
|
|
29
35
|
"pino-pretty": "^13.1.3",
|
|
30
|
-
"napcat-sdk": "0.1.
|
|
36
|
+
"napcat-sdk": "0.1.2"
|
|
31
37
|
},
|
|
32
38
|
"devDependencies": {
|
|
33
39
|
"tsdown": "^0.18.0",
|
package/readme.md
ADDED
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
|
-
})
|