kolaris-bot
v0.1.1
Published
icqq bot 框架
Downloads
549
Readme
kolaris-bot
Usage
import { Kolaris } from 'kolaris-bot'
new Kolaris({
uin: 619113277,
// 私聊管理插件启、停的指令
command: 'plug',
// 插件存储目录
pluginDir: 'plugins',
master: [619113277],
config: {
platform: 5,
ver: '9.0.56',
sign_api_addr: xxx,
ignore_self: false,
},
}).start()
插件写法
import { defineBotPlugin, MessageMiddleware, Plugin } from 'kolaris-bot'
export default defineBotPlugin({
setup: (client, config) => {
const plugin = new Plugin(client, config)
plugin.onGroupMessage(
(data: GroupMessageEvent) => {
// 使用消息处理中间件
new MessageMiddleware<GroupMessageEvent>()
.startsWith('查信息')
.equal()
.getAt()
.getText()
// 还有更多...
.run(data, async ({ atList, restText }) => {
// logic here
})
// OR your code
},
)
return plugin
},
})
Note:插件目前仅支持 commonjs 并不支持esm