Home

Awesome

YZ-NEXT-PE

Yunzai-Bot Next PE 是 Next 库的纯净版

☞点击阅读文档了解更多

Code https://github.com/yunzai-org/yunzai-next

安装

必备条件ChromeNode.js@18GitRedis-6.2

git clone --depth=1 https://github.com/yunzai-org/yunzai-bot.git
cd yunzai-bot
# 国内镜像,已安装可忽视
npm config set registry https://registry.npmmirror.com
# yarn 不能使用2.x版本,它无法使用link
npm install yarn@1.19.1 -g
yarn --ignore-engines
# 运行
yarn app

自建

自建版本无v3环境

npm init

输入版本时,需要标记4.1.0,其他随意

npm install yarn@1.19.1 -g
yarn add yunzai react-puppeteer react puppeteer yz-system -W
import { createLogin, Client, Processor, Loader } from 'yunzai'
const initialize = () => {
  Processor.install()
  Loader.load()
}
const start = async () => {
  await createLogin()
  const T = await Client.run()
  if (T) {
    Bot.on('system.online', initialize)
  } else {
    initialize()
  }
}
setTimeout(start, 0)
import { defineConfig } from 'yunzai'
export default defineConfig({
  applications: ['yz-system']
})
/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = require('react-puppeteer/.puppeteerrc')
node src/main.js
node src/main.js --relogin
yarn add pm2 -W
/**
 * @type {{ apps: import("pm2").StartOptions[] }}
 */
module.exports = require('yunzai/pm2')
npx pm2 startOrRestart pm2.config.cjs