# kook-bot-ts

> 基于KBotify的Kook插件式机器人框架

Latest version **1.0.2** (published 2023-03-18) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install kook-bot-ts
pnpm add kook-bot-ts
yarn add kook-bot-ts
bun add kook-bot-ts
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-03-18 |
| First published | 2023-03-15 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 96 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | IAFEnvoy |
| Maintainers | iafenvoy |
| Keywords | bot, kook, kaiheila, framework, kbotify |

## Links

- npm: https://www.npmjs.com/package/kook-bot-ts
- Repository: https://github.com/IAFEnvoy/kook-bot-ts
- Homepage: https://github.com/IAFEnvoy/kook-bot-ts#readme
- Issues: https://github.com/IAFEnvoy/kook-bot-ts/issues
- npm.io page: https://npm.io/package/kook-bot-ts

## Dependencies (5)

- [fs](https://npm.io/package/fs.md) ^0.0.1-security
- [kbotify](https://npm.io/package/kbotify.md) ^0.2.10
- [request](https://npm.io/package/request.md) ^2.88.2
- [os-utils](https://npm.io/package/os-utils.md) ^0.0.14
- [readline](https://npm.io/package/readline.md) ^1.3.0

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-03-18
- 1.0.1 — 2023-03-15
- 1.0.0 — 2023-03-15

## README

# Kook-ts
基于KBotify的插件式框架

### 安装
``` batch
npm i --save kook-ts
```

### 快速上手
#### 启动代码
```javascript
const KookBot = require('kook-ts').KookBot;

const bot = new KookBot({
    token: '在这里放置你的token',
    plugin_folder: './plugins/',//插件放置位置，可更改
    ops: [],//op列表，不知道的可以先启动机器人然后在kook里面/me
    debug_command:true,//是否启用调试指令如/me，/here
})
```
#### 插件代码
```javascript
const onMessage = (client, msg) => {
    //client是KookBot
    //msg是TextMessage
}

const onLoad = (client) => {
    //client是KookBot
}

const config = {
    id: '',//必选，唯一id
    name: '',//必选，显示名称
    menu: ''//可选，菜单显示项
};

module.exports = { config, onMessage, onLoad };//除了config都是可选
```

### 管理员指令
#### 通用
`/plugin reload` 重载所有插件（在修改插件后）
`/enable <id>` 在当前频道启用插件
`/disable <id>` 在当前频道禁用插件
`/permission reload` 重载权限文件（在手动修改权限文件后）

#### 开票
`/ticket enable <type1> <type2> ...` 启用开票系统，注意需要在单独的一个分组里面使用，bot会自动创建入口
`/ticket disable` 禁用开票系统

---
_Source: https://npm.io/package/kook-bot-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
