alemonjs
v1.3.2
Published
啊柠檬脚本
Downloads
408
Readme
AlemonJS https://alemonjs.com
跨平台开发的事件驱动机器人 | 支持 QQ (群&频道)、KOOK、Discord
Ecosystem
| Project | Status | Description | | ----------------- | ---------------------------------------------------- | --------------- | | alemonjs | | 标准应用解析器 | | create-alemonjs | | 模板创建脚手架 | | alemon-ffmpeg | | ffmpeg 自动下载 |
Quick Start
可直接执行脚手架 并快速启动程序
npm install pnpm -g
pnpm create alemonjs@latest -y
cd alemonb
npm install
npm run dev
连接平台需要正确配置登录
alemon.login.ts
import { defineConfig } from 'alemonjs'
export default defineConfig({
// 配置名 test
test: {
// qq平台配置
qq: {
appID: 'your app id',
token: 'your token'
}
},
// 配置名 pro
pro: {
// kook平台配置
kook: {}
}
})
npm run [脚本名] [配置名] [平台名]
启动时带上匹配规则机器人正确启动
npm run dev test qq
Development Examples
import { createApp, Events, Messages } from 'alemonjs'
// 监听事件
const event = new Events()
event.response('MEMBERS', async e => {
if (/^你好$/.test(e.msg)) e.reply('你好呀')
})
event.response('MEMBERS', async e => {
console.log('成员', e.user_name, '加入')
})
// 响应消息
const message = new Messages()
message.response(/^最近怎么样/, async e => {
e.reply('很好')
})
// 构建应用
const app = createApp(import.meta.url)
app.on(event.ok)
app.use(message.ok)
app.mount()
Community
QQ Group 806943302