Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
* Update readme
  • Loading branch information
Lhcfl authored Nov 30, 2023
1 parent 186491c commit a42f3af
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

## How to use

### Dev Install 开发者安装

适用于希望对该bot做出开发,或者可能改动代码的人员

复制 `config.example.yml``config.yml`

```
Expand All @@ -14,13 +18,66 @@ cp config.example.yml config.yml

接下来,按 `config.example.yml` 的说明配置 `config.yml`

安装依赖(包括devDependences)

```
npm install
```

安装其他依赖见 User Install部分

最后,启动

```
npm run build
npm run start
```

### User Install 用户安装

适用于不希望对该bot做出改动,直接上手的人员

创建一个文件夹容纳该bot (注意:bot会将数据文件存放在该文件夹的data子文件夹)

```
mkdir linquebot2
cd linquebot2
git clone https://github.com/Lhcfl/Linquebot_v2 -b build
cp Linquebot_v2/config.example.yml ./config.yml
```

配置 `config.yml`

安装依赖

```
npm install --omit=dev
```

安装其他依赖:

- **waife模块**

- Graphviz:
```
sudo apt install graphviz -y
```
- 全字体:
```
sudo apt install -y --force-yes --no-install-recommends fonts-noto fonts-noto-cjk fonts-noto-cjk-extra fonts-noto-color-emoji ttf-ancient-fonts
```

启动

```
cd Linquebot_v2
npm run run
```

## Develop Plugin

[Api referances](https://lhcfl.github.io/Linquebot_v2/)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,5 @@ export function botOnOffRegister(func: typeof on_off_mode) {
* @returns bot是否处于打开状态
*/
export async function botOnOff(app: App, msg: Message): Promise<boolean> {
return await on_off_mode(app, msg);
return Boolean(await on_off_mode(app, msg));
}
2 changes: 1 addition & 1 deletion src/plugins/bot_on_off/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const bot_status: commandHandleFunction = async (app, msg) => {
};

const init: PluginInit = (app) => {
console.log('xxx loaded!');
console.log('bot_on_off loaded!');
app.db.register('is turned on', [() => true]);
botOnOffRegister(
async (_, msg) => await app.db.peek_path<boolean>(['is turned on', msg.chat.id], (val) => val)
Expand Down

0 comments on commit a42f3af

Please sign in to comment.