Giter Club home page Giter Club logo

picplug's Introduction

PicPlug

Language

Code Size Release Download Star

目前已使用kotlin进行了重构,老版本请前往java分支获取

一个简单的机器人发图插件

使用kotlin重新精简了代码,并优化了旧版的使用体验, 日常的管理和配置都可以通过和机器人私聊完成

使用说明

安装

release界面下载jar包,然后放置到plugins文件下即可

说明

出于避免打扰群友的考虑,插件默认不对任何群启用功能(除非你的群正好命中了配置文件里默认生成的示例群号), 控制插件的启用可以通过机器人的私聊窗口进行白名单的管理,也可以手动修改配置文件

群员的管理机制采用黑名单机制(添加白名单确实太麻烦)

使用前请配置好管理员qq

配置管理指令

特别提醒:由于mirai的配置文件自动保存机制, 通过机器人指令完成的修改需要等待一段时间才会保存至配置文件中, 如果控制台还没自动保存就关闭了mirai-console,会导致指令修改无效。 一般配置后等待几分钟即可完成保存

指令名 作用
help 显示帮助信息
check 显示当前的配置情况
g+ <group id> 向群白名单中添加一个群
g- <group id> 从群白名单中移除一个群
m+ <member id> 向群员黑名单中添加群员
m- <member id> 从群员黑名单中移除群员
l+ <api link> 向API库中添加一个图片API链接
l- <api link> 从API库中移除一个图片API链接

图片API无法删空,而且添加API链接时不会检查链接的可用性,需要自行确保正确, 并且api链接应该是直接返回图片而非返回包含图片地址等信息的json

配置文件结构

# 默认的图片API,可依据需求自行更改,但务必保证返回的结果是一张图片,最好是jpg,其他不做可用性保证
imageAPIs:
  - 'https://imgapi.cn/cos.php?return=img'
whiteGroupList:
  - 1234567890
banQQList:
  - 123123123
adminQQ: 123123123
# 触发发图指令
# 第1个指令为随机触发设置的API
# 如果有,第2个指令固定触发第1个API
# 如果有,第3个指令固定触发第2个API
# 依次类推
# !!!如果设定的指令数大于(API数+1),则自动取模从头开始计算!!!
# 例如: 3个API 5个指令
#       则第5个指令触发第一个API
commands:
  - !!gkd
# 图片下载失败之后的重试次数
retryCount: 5
# 发图冷却时间
cd: 1000

picplug's People

Contributors

vatinacharo 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.