Code Monkey home page Code Monkey logo

linquebot_v2's Introduction

Linquebot_v2

build status doc status lint status

How to use

Dev Install 开发者安装

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

复制 config.example.ymlconfig.yml

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

Linquebot的基本组成部分是 Plugin。每个 Plugin 单独在 src/plugins/ 下有一个文件夹。

每个 Plugin 必须有一个 index.js (或 index.ts 然后编译) export 一个 PluginInit 类型的 init

下面是一个 Plugin 的 index.ts 的模板:

import { commandHandleFunction } from '@/lib/command.js';
import { PluginInit } from '@/types/plugin.js';

const sayHello: commandHandleFunction = (app, msg) => {
  app.bot.sendMessage(msg.chat.id, 'hello, world!');
};

const init: PluginInit = (app) => {
  console.log('plugin loaded!');
  app.registCommand({
    command: 'hellp',
    chat_type: 'all',
    description: 'say hello',
    handle: sayHello,
  });
};

export { init };

linquebot_v2's People

Contributors

lhcfl avatar 91khr avatar tagbug avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.