0.1.7 • Published 3 months ago

kolaris-bot v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

kolaris-bot

npm version npm downloads bundle JSDocs

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

License

MIT License © 2024-PRESENT 14K

0.1.7

3 months ago

0.1.5

5 months ago

0.1.4

5 months ago

0.1.2

6 months ago

0.1.1

7 months ago

0.1.0

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago