🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

littlebad-bot

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

littlebad-bot

基于 [oicq](https://github.com/takayama-lily/oicq) 开发的机器人平台,提供一些方便的接口简化插件开发

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

阿坏机器人

基于 oicq 开发的机器人平台,提供一些方便的接口简化插件开发

安装

npm install littlebad-bot
or
yarn add littlebad-bot

示例代码

  • 创建机器人
const bot = createBot({
    qq: 1287299719,
    managers: [548481661],
    dataPath: "botData/" + 1287299719
})
bot.start()
  • 创建插件并使用
class Setu extends BasePlugin {
    orderKeys = ["setu"]

    onOrder(e) {
        e.reply("不准色色")
    }
}

const bot = createBot({
    qq: 1287299719,
    managers: [548481661],
    dataPath: "botData/" + 1287299719
})
bot.use(new Setu())
bot.start()

指令细分

class Setu extends BasePlugin {

    setu = ["setu"]
    noSetu = ["noSetu"]
    orderKeys = [...this.setu, ...this.noSetu]
    orders = [
        this.onSetu.bind(this),
        this.onNoSetu.bind(this)
    ]

    onSetu(e) {
        // 在此判断指令触发语句条件或其他条件
        if (this.triggerKey(e.raw_message, this.setu)) {
            return e.reply("不准色色")
        }
    }

    onNoSetu(e) {
        if (this.triggerKey(e.raw_message, this.noSetu)) {
            return e.reply("好")
        }
    }
}

目前已搭载插件

  • 值班提醒bot
  • 消息转发bot
  • 点赞bot
  • 好看图片bot

计划列表

开发计划状态
好图新图源
收集值班空闲时间插件
频道机器人整合
好友管理📅

欢迎提issue&pr

FAQs

Package last updated on 19 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts