kotori-bot
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -7,14 +7,23 @@ "use strict"; | ||
const cac_1 = __importDefault(require("cac")); | ||
const loader_1 = __importDefault(require("@kotori-bot/loader")); | ||
const loader_1 = require("@kotori-bot/loader"); | ||
const fs_1 = require("fs"); | ||
const program = (0, cac_1.default)(); | ||
const pkg = JSON.parse((0, fs_1.readFileSync)(`${__dirname}/../package.json`).toString()); | ||
program.version(pkg.verion); | ||
program.version(pkg.verion, '-v, --version'); | ||
program | ||
.command('serve') | ||
.option('--mode [value]', 'Set running mode of program') | ||
.command('') | ||
.option('--dir [path]', 'Set running root dir of program') | ||
.action((...args) => { | ||
console.log(args); | ||
new loader_1.default().run(); | ||
.action((options) => { | ||
loader_1.Logger.info(options); | ||
new loader_1.Loader({ mode: 'build' }).run(); | ||
}); | ||
program | ||
.command('ui') | ||
.option('-l, --lang', 'Set view language of ui') | ||
.action((options) => { | ||
loader_1.Logger.info('ui', options); | ||
}); | ||
program.command('module').action(() => loader_1.Logger.info('module')); | ||
program.command('module search <name>').action(() => loader_1.Logger.info('module search')); | ||
program.command('module download <name>').action(() => loader_1.Logger.info('module download')); | ||
program.parse(); |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const loader_1 = __importDefault(require("@kotori-bot/loader")); | ||
globalThis.env_mode = 'dev'; | ||
const kotori = new loader_1.default(); | ||
const loader_1 = require("@kotori-bot/loader"); | ||
const kotori = new loader_1.Loader({ mode: 'dev' }); | ||
kotori.run(); |
@@ -1,4 +0,4 @@ | ||
import { Context } from '@kotori-bot/core'; | ||
export * from '@kotori-bot/core'; | ||
export declare const Kotori: typeof Context & Context; | ||
export * from '@kotori-bot/loader'; | ||
export declare const Kotori: import("@kotori-bot/core").Context; | ||
export default Kotori; |
@@ -20,3 +20,4 @@ "use strict"; | ||
__exportStar(require("@kotori-bot/core"), exports); | ||
// const ctx = ContextInstance.get(); | ||
__exportStar(require("@kotori-bot/loader"), exports); | ||
// const ctx = Container.get(); | ||
// namespace KotoriSpace { | ||
@@ -38,10 +39,10 @@ // /* Core Class */ | ||
// } | ||
exports.Kotori = new Proxy(core_1.ContextInstance.getMixin(), { | ||
exports.Kotori = new Proxy(core_1.Container.getMixin(), { | ||
get: (_, prop) => { | ||
const target = core_1.ContextInstance.getMixin(); | ||
const target = core_1.Container.getMixin(); | ||
if (prop === undefined) | ||
return target; | ||
return target[prop]; | ||
}, | ||
} | ||
}); | ||
exports.default = exports.Kotori; |
{ | ||
"name": "kotori-bot", | ||
"version": "v1.1.0", | ||
"version": "v1.2.0", | ||
"description": "ChatBot Framework Base For NodeJS And TypeScript", | ||
@@ -9,9 +9,8 @@ "main": "lib/index.js", | ||
"bin": { | ||
"kotori": "./lib/cli.js" | ||
"kotori": "./bin.js" | ||
}, | ||
"keywords": [ | ||
"kotori", | ||
"chatbot", | ||
"bot", | ||
"typescript", | ||
"robotics", | ||
"nodejs", | ||
@@ -22,2 +21,4 @@ "back-end" | ||
"lib", | ||
"kotori.yml", | ||
"bin.js", | ||
"LICENSE", | ||
@@ -36,9 +37,16 @@ "README.md" | ||
"cac": "^6.7.14", | ||
"@kotori-bot/core": "^v1.1.0", | ||
"@kotori-bot/loader": "^v1.2.0" | ||
"commander": "^12.0.0", | ||
"@kotori-bot/core": "^v1.2.0", | ||
"@kotori-bot/loader": "^v1.3.0" | ||
}, | ||
"devDependencies": { | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.1.3" | ||
}, | ||
"scripts": { | ||
"start": "node ./lib/start.js", | ||
"dev": "ts-node --esm -r tsconfig-paths/register ./src/dev.ts --no-signale", | ||
"cli:dev": "ts-node --esm -r tsconfig-paths/register ./src/cli.ts --no-signale", | ||
"build": "tsc --build" | ||
} | ||
} |
@@ -10,3 +10,3 @@ <div align="center"> | ||
![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/biyuehu/biyuehu) ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/t/kotorijs/kotori/master) ![GitHub contributors](https://img.shields.io/github/contributors/biyuehu/kotori-bot) ![GitHub](https://img.shields.io/github/license/biyuehu/kotori-bot?color=deepgreen) ![npm](https://img.shields.io/npm/v/kotori-bot) ![GitHub Repo stars](https://img.shields.io/github/stars/biyuehu/kotori-bot?style=social) | ||
[![Build](https://github.com/kotorijs/kotori/actions/workflows/build.yml/badge.svg)](https://github.com/kotorijs/kotori/actions/workflows/build.yml) ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/biyuehu/biyuehu) ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/t/kotorijs/kotori/master) ![GitHub contributors](https://img.shields.io/github/contributors/biyuehu/kotori-bot) ![GitHub](https://img.shields.io/github/license/biyuehu/kotori-bot?color=deepgreen) ![npm](https://img.shields.io/npm/v/kotori-bot) ![GitHub Repo stars](https://img.shields.io/github/stars/biyuehu/kotori-bot?style=social) | ||
@@ -17,3 +17,3 @@ </div> | ||
kotori 是一个**跨平台、解耦合、现代化**于一体的 ChatBot 聊天机器人 框架,运行于 NodeJS 环境并使用 TypeScript 语言开发。 | ||
kotori 是一个**跨平台、解耦合、现代化**于一体的聊天机器人框架,运行于 NodeJS 环境并使用 TypeScript 语言开发。 | ||
@@ -24,5 +24,5 @@ --- | ||
**Kotori**是一个罗马字,在日语中是**ことり(小鳥)**的意思,该名字取自于[Key](http://key.visualarts.gr.jp/)公式游戏[《Rewrite》](https://bgm.tv/subject/4022)及其衍生作品中的主要女性角色之一的**[神户小鸟](https://bgm.tv/character/12063)**(神戸(かんべ) 小鳥(ことり))。 | ||
「Kotori」是一个罗马字,在日语中是「ことり」(小鳥)的意思,发音为 `/kotoɾʲi‾/` <Voice />,该名字取自于 [Key 公式](http://key.visualarts.gr.jp/) 的游戏 [《Rewrite》](https://bgm.tv/subject/4022) 及其衍生作品中的主要女性角色之一的 [神户小鸟](https://bgm.tv/character/12063) (神戸(かんべ) 小鳥(ことり))。 | ||
### Advantages | ||
### Advantage | ||
@@ -36,75 +36,28 @@ - **跨平台** | ||
- **现代化** | ||
Kotori 使用现代化的 ECMAScript 语法规范与强大的 TypeScript 类型检查 | ||
使用现代化的 ECMAScript 语法规范与强大的 TypeScript 类型检查 | ||
## Reference | ||
### Supports | ||
- [变更日志](CHANGELOG.md) | ||
#### Platform | ||
<!-- | ||
## kotori支持的连接模式 | ||
- QQ(基于 Tencent 官方 API) | ||
- QQ(基于 Onebot 标准的 [go-cqhttp](https://github.com/Mrs4s/go-cqhttp) 项目) | ||
- CMD 命令行 | ||
即将支持: | ||
- Telegram | ||
- Kook/开黑啦 | ||
- MinecraftBedrock(基于 Websocket) | ||
- WeChat/微信 | ||
- Discord | ||
- [x] 正向 WebSocket | ||
- [x] 反向 WebSocket | ||
#### Database(待支持) | ||
kotori目前现已支持go-cqhttp提供的67种`Api`,19种`Event`,18种`CQ Code` | ||
- Memory | ||
- Sqlite | ||
- Mysql | ||
## 关于插件 | ||
--- | ||
> [插件中心](docs/PLUGINS.md) | ||
## Reference | ||
收集插件将不定期更新,你可以直接通过**Pull Request**的方式将你的插件加入(或更新时)到仓库并更新`docs/PLUGINS.md`中的插件列表信息 | ||
> 以下内容已不保证时效性 | ||
### 从源码里构建 | ||
如果你想将KotoriBot作为一个NPM包或者说node项目库来导入到你自己的项目使用搭建机器人的话,由于TS语言本身的原因,无法直接导入纯TypeScript项目,需要先构建一遍TS源码 | ||
```bash | ||
npm run build | ||
``` | ||
构建完成后的文件将生成在`dist/`文件下,但你无需顾忌这么多,直接引入即可 | ||
- TypeScript(.ts) | ||
```typescript | ||
import Kotori from 'kotori-bot'; | ||
const Bot = new Kotori( | ||
{ | ||
mode: 'WsReverse', | ||
port: 8080, | ||
}, | ||
(Event: any, Api: any) => { | ||
/* ... */ | ||
}, | ||
); | ||
Bot.create(); | ||
``` | ||
- JavaScript With CommonJS(.js .cjs) | ||
```javascript | ||
const Kotori = require('kotori-bot'); | ||
const Bot = new Kotori( | ||
{ | ||
mode: 'WsReverse', | ||
port: 8080, | ||
}, | ||
(Event, Api) => { | ||
/* ... */ | ||
}, | ||
); | ||
Bot.create(); | ||
``` | ||
- JavaScript With ESModule(.mjs) | ||
```javascript | ||
import Kotori from 'kotori-bot'; | ||
//... | ||
``` | ||
> 该方式下运行不会读取项目下的配置文件,需在实例化时传入配置参数,详细说明参考 | ||
--> | ||
- [Kotori Docs](https://kotori.js.org/) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
13
93
1
42041
4
2
60
+ Addedcommander@^12.0.0
+ Addedcommander@12.1.0(transitive)
Updated@kotori-bot/core@^v1.2.0
Updated@kotori-bot/loader@^v1.3.0