kokkoro-plugin-hitokoto 2.0.0 → 2.0.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/README.md +23 -0
- package/lib/index.js +2 -2
- package/package.json +2 -2
- package/src/index.ts +2 -2
- package/tsconfig.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# kokkoro-plugin-hitokoto
|
|
2
|
+
|
|
3
|
+
ヒトコト
|
|
4
|
+
|
|
5
|
+
**Install:**
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm i kokkoro-plugin-hitokoto
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Usage:**
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import { mountPlugin } from '@kokkoro/core';
|
|
15
|
+
|
|
16
|
+
await mountPlugin('kokkoro-plugin-hitokoto');
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Command:**
|
|
20
|
+
|
|
21
|
+
格式:`/来点骚话`
|
|
22
|
+
场景:群聊 & 频道
|
|
23
|
+
功能:随机输出一言语句
|
package/lib/index.js
CHANGED
|
@@ -4,8 +4,8 @@ export const metadata = {
|
|
|
4
4
|
description: '一言语句',
|
|
5
5
|
};
|
|
6
6
|
export default function Hitokoto() {
|
|
7
|
-
useCommand('/来点骚话', async (
|
|
8
|
-
const { data } = await bot.request.get('https://v1.hitokoto.cn?c=a&c=b');
|
|
7
|
+
useCommand('/来点骚话', async (ctx) => {
|
|
8
|
+
const { data } = await ctx.bot.request.get('https://v1.hitokoto.cn?c=a&c=b');
|
|
9
9
|
const { hitokoto, from } = data;
|
|
10
10
|
const message = `『${hitokoto}』——「${from}」`;
|
|
11
11
|
return message;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kokkoro-plugin-hitokoto",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "ヒトコト",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "Yuki <admin@yuki.sh>",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@kokkoro/core": "^3.0.
|
|
17
|
+
"@kokkoro/core": "^3.0.5"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc && tsc-alias",
|
package/src/index.ts
CHANGED
|
@@ -32,8 +32,8 @@ export const metadata: Metadata = {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export default function Hitokoto() {
|
|
35
|
-
useCommand('/来点骚话', async
|
|
36
|
-
const { data } = await bot.request.get<Hitokoto>('https://v1.hitokoto.cn?c=a&c=b');
|
|
35
|
+
useCommand('/来点骚话', async ctx => {
|
|
36
|
+
const { data } = await ctx.bot.request.get<Hitokoto>('https://v1.hitokoto.cn?c=a&c=b');
|
|
37
37
|
const { hitokoto, from } = data;
|
|
38
38
|
const message = `『${hitokoto}』——「${from}」`;
|
|
39
39
|
|