From 7bc19af96ed622368f7c081f01752aab26cdcf57 Mon Sep 17 00:00:00 2001 From: xia__mc <108219418+xia-mc@users.noreply.github.com> Date: Thu, 9 May 2024 17:01:20 +0800 Subject: [PATCH 1/5] Create README_CN.md --- README_CN.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 README_CN.md diff --git a/README_CN.md b/README_CN.md new file mode 100644 index 0000000..c93477f --- /dev/null +++ b/README_CN.md @@ -0,0 +1,85 @@ +
+ +# Sekai.explode + +一种基于 **discord.js V14** 的多功能机器人。 + +![Alt](https://repobeats.axiom.co/api/embed/b7fc33791d3233660e7c02524ace22c31b66e890.svg "Repobeats analytics image") + +
+ +## 这是什么? +一种基于 [```discord.js V14```](https://discord.js.org/) 开发的多功能Discord机器人。 + +项目的初衷是方便初学者使用,易于添加和删除功能。 + +## 快速开始 +本项目作为一个公共机器人全天候运行,点击[此处](https://discord.com/api/oauth2/authorize?client_id=1144600133762293800&permissions=8&scope=bot)以快速添加到你的服务器。 + +## 本地部署 +### 环境要求 +- 已安装 [```Node.js```](https://nodejs.org/en) (推荐使用 v18 或更高版本) +- 已安装 [```Npm```](https://www.npmjs.com/) 或 [```Yarn```](https://yarnpkg.com/) +- 已安装 [```Git```](https://git-scm.com/) +- **可选)** 已安装 [```pm2```](https://pm2.io/) +> ⚠ 如果 PM2 不可用,```/update``` 命令将无法运行。 + +### 开始部署 + +> ⚠ 开始部署前请先检查环境要求。 + +1. 运行 `git clone` 克隆此版本库。 +2. 运行 `npm install` 安装依赖项。 +3. 复制 `config.json.example` 并重命名为 `config.json`。 +4. 编辑 `config.json`。 +6. 使用 `npm start` 或 `pm2 start npm -- start` 启动。 +7. 大功告成! + + +### 注册命令 + +#### 向```misc```软件包添加 +只需要在```packages/misc/commands```目录下创建你的文件,启动时会自动加载。 + +##### 例: +```js +const { SlashCommandBuilder } = require('discord.js'); + +module.exports = { + data: new SlashCommandBuilder() + .setName('hello') + .setDescription('Hello World!'), + execute: async function (interaction) { + await interaction.reply('Hello World!') //処理を記述 + } +}; +``` + +### 添加软件包 +在 `packages` 目录下创建一个工作区,软件包会自动加载。 +```sh +npm init -w packages/example +``` + +在入口点文件(如 ```index.js```)中添加命令并导出功能。 + +#### 例: +```js +const { CommandManager } = require('../../internal/commands'); +const upload = require('./upload'); + +class ExampleFeature { + onLoad() { + CommandManager.default.addCommands({ + data: new SlashCommandBuilder() + .setName('hello') + .setDescription('Hello World!'), + execute: async function (interaction) { + await interaction.reply('Hello World!') //処理を記述 + } + }); + } +} + +module.exports = { feature: new ExampleFeature() }; +``` From 783b7abdb21a0e945de635bba8dddd8dd03e3fec Mon Sep 17 00:00:00 2001 From: xia__mc <108219418+xia-mc@users.noreply.github.com> Date: Thu, 9 May 2024 17:07:11 +0800 Subject: [PATCH 2/5] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index c93477f..b7a3b76 100644 --- a/README_CN.md +++ b/README_CN.md @@ -32,8 +32,8 @@ 2. 运行 `npm install` 安装依赖项。 3. 复制 `config.json.example` 并重命名为 `config.json`。 4. 编辑 `config.json`。 -6. 使用 `npm start` 或 `pm2 start npm -- start` 启动。 -7. 大功告成! +5. 使用 `npm start` 或 `pm2 start npm -- start` 启动。 +6. 大功告成! ### 注册命令 From 16f8f096d60ccac2e75a548a610486bebe574285 Mon Sep 17 00:00:00 2001 From: xia__mc <108219418+xia-mc@users.noreply.github.com> Date: Thu, 9 May 2024 17:08:21 +0800 Subject: [PATCH 3/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6b55307..646bfb0 100755 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![Alt](https://repobeats.axiom.co/api/embed/b7fc33791d3233660e7c02524ace22c31b66e890.svg "Repobeats analytics image") +[简体中文](README_CN.md) ## What's this? discord.js@v14を使用した、多機能botです。 From 042ccca16fa8d0fc53074619a565ed4021679f33 Mon Sep 17 00:00:00 2001 From: xia__mc <108219418+xia-mc@users.noreply.github.com> Date: Thu, 9 May 2024 17:09:31 +0800 Subject: [PATCH 4/5] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index b7a3b76..087cbb6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -41,7 +41,7 @@ #### 向```misc```软件包添加 只需要在```packages/misc/commands```目录下创建你的文件,启动时会自动加载。 -##### 例: +**例:** ```js const { SlashCommandBuilder } = require('discord.js'); @@ -63,7 +63,7 @@ npm init -w packages/example 在入口点文件(如 ```index.js```)中添加命令并导出功能。 -#### 例: +**例:** ```js const { CommandManager } = require('../../internal/commands'); const upload = require('./upload'); From e6ffdc020bc11ed32ecdc756400882bee62a0895 Mon Sep 17 00:00:00 2001 From: xia__mc <108219418+xia-mc@users.noreply.github.com> Date: Thu, 9 May 2024 17:18:49 +0800 Subject: [PATCH 5/5] Update README_CN.md --- README_CN.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index 087cbb6..456b625 100644 --- a/README_CN.md +++ b/README_CN.md @@ -50,7 +50,8 @@ module.exports = { .setName('hello') .setDescription('Hello World!'), execute: async function (interaction) { - await interaction.reply('Hello World!') //処理を記述 + // 在这里开始你的代码 ↓ + await interaction.reply('Hello World!') } }; ``` @@ -75,7 +76,8 @@ class ExampleFeature { .setName('hello') .setDescription('Hello World!'), execute: async function (interaction) { - await interaction.reply('Hello World!') //処理を記述 + // 在这里开始你的代码 ↓ + await interaction.reply('Hello World!') } }); }