@atri-bot/plugin-ping 1.1.4 → 1.1.6
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.d.mts +23 -0
- package/dist/index.mjs +1 -0
- package/package.json +12 -12
- package/dist/index.d.ts +0 -19
- package/dist/index.js +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as _atri_bot_core0 from "@atri-bot/core";
|
|
2
|
+
import { CommandContext } from "@atri-bot/core";
|
|
3
|
+
import yargs from "yargs";
|
|
4
|
+
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
declare const PingPlugin: _atri_bot_core0.definePluginReturnType<{
|
|
7
|
+
defaultReply: string;
|
|
8
|
+
}, {
|
|
9
|
+
pluginName: string;
|
|
10
|
+
defaultConfig: {
|
|
11
|
+
defaultReply: string;
|
|
12
|
+
};
|
|
13
|
+
install(): void;
|
|
14
|
+
uninstall(): void;
|
|
15
|
+
handlePingCommand({
|
|
16
|
+
context,
|
|
17
|
+
options
|
|
18
|
+
}: CommandContext<"message", yargs.Argv<{
|
|
19
|
+
reply: string;
|
|
20
|
+
}>>): Promise<void>;
|
|
21
|
+
}>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { PingPlugin };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{definePlugin as e}from"@atri-bot/core";import{Structs as t}from"node-napcat-ts";import n from"yargs";var r=`@atri-bot/plugin-ping`;const i=e(()=>{let e={ping:n().option(`reply`,{alias:`r`,type:`string`,description:`自定义回复内容`,demandOption:!0})};return{pluginName:r,defaultConfig:{defaultReply:`pong`},install(){this.regCommandEvent({trigger:`ping`,commander:e.ping,callback:async({context:e,options:n})=>{await this.bot.sendMsg(e,[t.text(n.reply??this.config.defaultReply)],{reply:!1,at:!1})}}),this.regCommandEvent({trigger:`ping2`,commander:e.ping,callback:this.handlePingCommand})},uninstall(){},async handlePingCommand({context:e,options:n}){await this.bot.sendMsg(e,[t.text(n.reply??this.config.defaultReply)],{reply:!1,at:!1})}}});export{i as PingPlugin};
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atri-bot/plugin-ping",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.1.6",
|
|
4
5
|
"description": "ping plugin for atri framework",
|
|
5
6
|
"author": "huan_kong",
|
|
6
7
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
8
|
+
"main": "./dist/index.mjs",
|
|
9
|
+
"types": "./dist/index.d.mts",
|
|
10
10
|
"files": [
|
|
11
11
|
"./dist/**/*"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "
|
|
15
|
-
"clean": "rimraf dist",
|
|
14
|
+
"build": "tsdown",
|
|
16
15
|
"lint": "eslint",
|
|
17
|
-
"
|
|
18
|
-
"type-check": "tsc --noEmit -p tsconfig.json --composite false"
|
|
16
|
+
"typecheck": "tsc --noEmit -p tsconfig.json --composite false"
|
|
19
17
|
},
|
|
20
18
|
"dependencies": {
|
|
21
|
-
"@atri-bot/core": "^
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
19
|
+
"@atri-bot/core": "^2.0.0-beta.6",
|
|
20
|
+
"node-napcat-ts": "^0.4.23",
|
|
21
|
+
"yargs": "^18.0.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/yargs": "^17.0.35"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BasePlugin } from '@atri-bot/core';
|
|
2
|
-
|
|
3
|
-
interface PingConfig {
|
|
4
|
-
defaultReply: string;
|
|
5
|
-
}
|
|
6
|
-
interface PingCommandContext {
|
|
7
|
-
args: [string?];
|
|
8
|
-
params: {
|
|
9
|
-
reply?: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
declare class Plugin extends BasePlugin<PingConfig> {
|
|
13
|
-
defaultConfig: PingConfig;
|
|
14
|
-
load(): void;
|
|
15
|
-
unload(): void;
|
|
16
|
-
private handlePingCommand;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { type PingCommandContext, type PingConfig, Plugin };
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{BasePlugin as o}from"@atri-bot/core";import{Command as i}from"commander";import{convertCQCodeToJSON as m}from"node-napcat-ts";var e=class extends o{defaultConfig={defaultReply:"pong"};load(){this.regCommandEvent({commandName:"ping",commander:new i().description("\u6D4B\u8BD5\u673A\u5668\u4EBA\u662F\u5426\u5728\u7EBF").argument("[reply]","\u56DE\u590D\u5185\u5BB9").option("-r, --reply [reply]","\u56DE\u590D\u5185\u5BB9"),callback:this.handlePingCommand.bind(this)})}unload(){}async handlePingCommand({context:n,args:a,params:t}){await this.bot.sendMsg(n,m(t.reply??a[0]??this.config.defaultReply),{reply:!1,at:!1})}};export{e as Plugin};
|