Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Maseshi/Shioru
Browse files Browse the repository at this point in the history
  • Loading branch information
Maseshi committed May 2, 2024
2 parents 4e589f0 + 7cd9c51 commit 33baf21
Show file tree
Hide file tree
Showing 30 changed files with 2,711 additions and 1,589 deletions.
144 changes: 90 additions & 54 deletions documents/README.bg.md

Large diffs are not rendered by default.

145 changes: 90 additions & 55 deletions documents/README.cs.md

Large diffs are not rendered by default.

144 changes: 90 additions & 54 deletions documents/README.da.md

Large diffs are not rendered by default.

146 changes: 90 additions & 56 deletions documents/README.de.md

Large diffs are not rendered by default.

144 changes: 90 additions & 54 deletions documents/README.el.md

Large diffs are not rendered by default.

145 changes: 90 additions & 55 deletions documents/README.en-GB.md

Large diffs are not rendered by default.

113 changes: 49 additions & 64 deletions documents/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/icons/apple-icon.png" width="100" style="border-radius: 100%;" />
<strong>
<h1>Shioru</h2>
<p>Personal assistants in Discord that will help make your guild a better place.</p>
<p>เลขาส่วนตัวใน Discord ที่จะช่วยทำให้กิลด์ของคุณน่าอยู่ยิ่งขึ้น</p>
</strong>
<img src="https://img.shields.io/badge/discord.js-v14-7354F6?logo=discord&logoColor=white" />
<img src="https://img.shields.io/github/stars/Maseshi/Shioru.svg?logo=github" />
Expand All @@ -25,7 +25,7 @@

[Switch Languages](https://github.com/Maseshi/Shioru/tree/main/documents)

Your best personal assistants will help your guild look more lively. She can do so many things that you can easily see detailed information on all commands by typing `/help`.
เลขาส่วนตัวที่ดีที่สุดของคุณจะช่วยให้กิลด์ของคุณดูมีชีวิตชีวามากขึ้น เธอสามารถทำสิ่งต่าง ๆ ได้หลายอย่างซึ่งคุณสามารถดูรายละเอียดข้อมูลของคำสั่งทั้งหมด ได้ง่าย ๆ โดยพิมพ์ `/help`

<div align="center">
<a href="https://discord.com/api/oauth2/authorize?client_id=704706906505347183&permissions=8&scope=applications.commands%20bot&redirect_uri=https%3A%2F%2Fshiorus.web.app%2Fthanks-you">
Expand All @@ -43,90 +43,86 @@ Your best personal assistants will help your guild look more lively. She can do
- Support customization of server notifications
- You can chat by typing `@Shioru` followed by the message you wish to communicate.
- Able to use application commands (/)
- Simulate a database system for testing
- Supports working on shards
- จำลองระบบฐานข้อมูลสำหรับทดสอบ
- รองรับการทำงานบน Shard

And many other interesting features...

## Prerequisites

- [Node.js](https://nodejs.org/) v18.0.0 or higher
- [Python](https://www.python.org/downloads/) v3.8.0 or higher
- [Java](https://www.oracle.com/java/technologies/downloads/) v11.0.0 or higher
- [Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) or [manual install](#1-install-build-tools)
- [Node.js](https://nodejs.org/) v20.6.0 หรือมากกว่า
- [Python](https://www.python.org/downloads/) v3.8.0 หรือมากกว่า
- [Java](https://www.oracle.com/java/technologies/downloads/) v11.0.0 หรือมากกว่า
- [Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) หรือ[ติดตั้งด้วยตัวเอง](#1-ติดตั้ง-build-tools)
- [Firebase Tools](https://firebase.google.com/docs/cli)
- [FFmpeg](https://ffmpeg.org/download.html)
- [FFmpeg](https://www.ffmpeg.org/download.html)
- [Git](https://git-scm.com/downloads)

## Installation
## การติดตั้ง

### 1. Install **Build Tools**
### 1. ติดตั้ง **Build Tools**

Install **Build tools** by running the following command according to your operating system.
ทำการติดตั้ง **Build tools** โดยรันคำสั่งดังต่อไปนี้ตามระบบปฏิบัติการของคุณ

- For Linux and MacOS operating systems
- สำหรับระบบปฏิบัติการ Linux และ MacOS

```sh
sudo apt update
sudo apt install build-essential
```

- For Windows operating system
- สำหรับระบบปฏิบัติการ Windows

```sh
npm install --global --production --add-python-to-path windows-build-tools
```

> **💡 TIP**: You can skip this step through the Node.js installer as shown in the following image. ![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/node-js-tools-for-native-modules.png)
> **💡 ทริป**: คุณสามารถข้ามขั้นตอนนี้ผ่านตัวติดตั้ง Node.js ดังภาพต่อไปนี้ ![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/node-js-tools-for-native-modules.png)
### 2. Clone the bot and install the components.
### 2. โคลนบอทและติดตั้งส่วนประกอบ

- Launch a terminal and run the following command.
- Launch a terminal and run the following commands.
```bat
git clone https://github.com/Maseshi/Shioru.git
cd Shioru
npm install
```
- Change the file name `.env.example` to `.env` and enter all required values.
> **💡 NOTE**: You can edit some data in **config** at [./source/configs/data.js](../source/configs/data.js).
- Rename the `.env.example` file to `.env` and add all values.

### 3. Setup bot and invite to join.
> **💡 หมายเหตุ:** คุณสามารถแก้ไขข้อมูลบางอย่างใน **config** ที่ [./source/configs/data.js](../source/configs/data.js)
- Go to [Discord Developer Portal](https://discord.com/developers/applications)
- Click **"New Application"** and name your bot and accept the Discord policy rules.
- Go to the **"Bot"** page and enable all options in the **Privileged Gateway Intent** section.
![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/discord-developer-portal-privileged-gateway-intents.png)
- Invite your bot to the server by going to the **OAuth2 > URL Generator** page, selecting `bot` and `applications.commands`, selecting `Administrator`, then copy the link and paste it in the browser address bar. Your sir
![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/discord-developer-portal-scopes.png)
### 3. ตั้งค่าบอทและเชิญเข้าร่วม

### 4. Setup database
- Go to the [Discord Developer Portal](https://discord.com/developers/applications)
- Click **"New Application"** and give your bot a name and accept the Discord policy rules.
- Go to the **"Bot"** page and enable all options in the **Privileged Gateway Intents** section. ![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/discord-developer-portal-privileged-gateway-intents.png)
- เชิญบอทของคุณไปที่เซิร์ฟเวอร์โดยไปที่หน้า **OAuth2 > URL Generator** เลือก `bot` และ `applications.commands` เลือก `Administrator` จากนั้นคัดลอกลิงก์และวางในแถบที่อยู่ของเบราว์เซอร์ของคุณ ![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/discord-developer-portal-scopes.png)

### 4. ตั้งค่าฐานข้อมูล

- Go to https://firebase.google.com/ and start setting up the project.
- Add a new project and follow the steps.
- Add your first application with **Website** Name your app without needing to select the **"Also set up Firebase Hosting for this app."** option and register the app.
![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/firebase-setup-web-application.png)
- Firebase will provide you with information about its configuration. Apply these values to the file. `.env`
- Add a new project and go through the steps.
- Add your first application with **Website**, name your app without the need to select **"Also set up Firebase Hosting for this app."** and register the app. ![](https://raw.githubusercontent.com/Maseshi/Shioru/main/assets/images/firebase-setup-web-application.png)
- Firebase จะให้ข้อมูลเกี่ยวกับการกำหนดค่าแก่คุณ นำค่าเหล่านี้ไปใช้กับไฟล์ `.env`
- Go to **Build > [Realtime Database](https://console.firebase.google.com/u/0/project/_/database/data)** to create a database for storing data.

## 🪛 Development
## 🪛 การพัฒนา

- Open a terminal and run `npm run emulators` to simulate the database system in **dev mode**.
- Open a new terminal and run the command `npm run dev`.
> **💡 NOTE**: When you enter development mode. Some features may be disabled, such as sending statistics, updating data, etc.
- เปิดเทอร์มินัลแล้วรัน `npm run emulators` เพื่อจำลองระบบฐานข้อมูลใน**โหมดพัฒนา**
- เปิดเทอร์มินัลหน้าใหม่แล้วรันคำสั่ง `npm run dev` > **💡 หมายเหตุ:** เมื่อคุณเข้าสู่โหมดการพัฒนา คุณลักษณะบางอย่างอาจถูกปิดใช้งาน เช่น การส่งสถิติ การอัปเดตข้อมูล เป็นต้น

## Serve
## จำลอง

Test the actual use by performing tasks similar to real use. The system will automatically calculate the split of the work fraction according to the number of guilds.
ทดสอบการใช้งานจริงด้วยการทำงานที่คล้ายกับการใช้งานจริง โดยระบบจะคำนวณการแยกเศษของการทำงานตามจำนวนของกิลด์โดยอัตโนมัติ

- Open a terminal and run `npm run emulators` to simulate the database system in **emulation mode**.
- Open a new terminal and run the command `npm run serve`.
> **💡 NOTE:** You will automatically enter development mode as this is a production simulation. Cause some features may not work.
- เปิดเทอร์มินัลแล้วรัน `npm run emulators` เพื่อจำลองระบบฐานข้อมูลใน**โหมดจำลอง**
- เปิดเทอร์มินัลหน้าใหม่แล้วรันคำสั่ง `npm run serve` > **💡 หมายเหตุ:** คุณจะเข้าสู่โหมดการพัฒนาโดยอัตโนมัติเนื่องจากเป็นการจำลองการใช้งานจริง ทำให้คุณสมบัติบางอย่างอาจไม่ทำงาน

## 🍵 Production
## 🍵 ใช้งานจริง

For actual use, the prepared command or set of commands can be used normally as follows:
สำหรับการใช้งานจริงสามารถใช้คำสั่งหรือชุดคำสั่งที่เตรียมไว้ได้ตามปกติ ดังนี้:

- On Linux or MacOS
- บน Linux หรือ MacOS

```sh
# with command file (recommend)
Expand All @@ -138,7 +134,7 @@ For actual use, the prepared command or set of commands can be used normally as
npm start
```

- On Windows
- บน Windows

```bat
@REM with command file (recommend)
Expand All @@ -150,42 +146,31 @@ For actual use, the prepared command or set of commands can be used normally as
npm start
```

### 🐳 Running on Docker
### 🐳 ทำงานบน Docker

This operation requires [Docker](https://www.docker.com/products/docker-desktop/)
การดำเนินการนี้จำเป็นต้องมี [Docker](https://www.docker.com/products/docker-desktop/)

- Use the command `npm run docker:build` and wait for all the work to complete.
- Then open the Docker program and run it with the required environment information (env) or use the command `npm run docker:run` and wait until the bot is running.
> **💡 NOTE**: You can check the functionality using the command `docker ps -a`.
- ใช้คำสั่ง `npm run docker:build` แล้วรอให้ทำงานเสร็จทั้งหมด
- จากนั้นเปิดโปรแกรม Docker แล้วสั่งรันพร้อมกับใส่ข้อมูลสภาพแวดล้อมที่จำเป็น (env) หรือใช้คำสั่ง `npm run docker:run` แล้วรอจนบอททำงาน > **💡 หมายเหตุ:** คุณสามารถตรวจสอบการทำงานได้โดยใช้คำสั่ง `docker ps -a`

## Quick Troubleshooting
## แก้ไขปัญหาอย่างรวดเร็ว

### `gyp ERR! stack Error: not found: make`

This problem may be caused by **Build tools** being installed incorrectly or may not have been installed yet. This problem can be solved by looking at the [installation](#1-install-build-tools) section.
ปัญหานี้อาจเกิดจาก **Build Tools** ติดตั้งไม่ถูกต้องหรืออาจยังไม่ได้ติดตั้ง วิธีแก้ไขปัญหานี้ให้ดูที่ส่วน[การติดตั้ง Build Tools](#1-ติดตั้ง-build-tools)

### `@firebase/firestore: Firestore (10.6.0): GrpcConnection RPC 'Write' stream 0x58a118ce error. Code: 14 Message: 14 UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 127.0.0.1:8080`

It is possible that you have not yet simulated the database system on the machine in test mode. You can solve this problem by closing the bot and running the following command on another page.
เป็นไปได้ว่าคุณยังไม่ได้จำลองระบบฐานข้อมูลบนเครื่องในโหมดทดสอบ โดยคุณสามารถแก้ปัญหานี้ได้โดยปิดบอทแล้วรันคำสั่งดังนี้ในอีกหน้าหนึ่ง

```bat
npm run emulators
```

## Improve Translate
## ปรับปรุงการแปลภาษา

You can help us translate existing languages or languages that are not currently available on [Crowdin](https://crowdin.com/project/shioru).

## Credits

Thank you to all the original creators for allowing us to use these wonderful works of yours.

Personal drawing by: [夏月 まりな (NATSUKI MARINA)](https://www.pixiv.net/en/users/482462)/[お着替え中](https://www.pixiv.net/en/artworks/76075098)

## Found a problem

If you encounter any problems from your current job You can let us know through the tab. [issue](https://github.com/Maseshi/Shioru/issues) of this repository.

## Google Translate

The content of this document has been translated by the [Google Translate](https://translate.google.com/) service. We apologize for any errors.
หากคุณพบปัญหาใดๆ จากการทำงานปัจจุบันของคุณ คุณสามารถแจ้งให้เราทราบได้ผ่านแท็บ [issues](https://github.com/Maseshi/Shioru/issues) ของพื้นที่เก็บนี้ได้
Loading

0 comments on commit 33baf21

Please sign in to comment.