0.1.7 • Published 6 months ago

kolaris-bot v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
6 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

6 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.2

9 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago