Skip to content

Commit

Permalink
Merge pull request #20 from web-tech-tw/docs
Browse files Browse the repository at this point in the history
docs: correct the contents
  • Loading branch information
supersonictw authored Jul 24, 2024
2 parents 39afb96 + e82b241 commit 0a10499
Show file tree
Hide file tree
Showing 17 changed files with 466 additions and 44 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ A simple bridge for every messenger.

![Arona](docs/statics/icon.min.png)

## Documentation

The documents and instructions is available on `/docs` of this repository.

[Here](docs/README.md)

## Discussion

Matrix room: [`#line:matrix.org`](https://matrix.to/#/#line:matrix.org)

## Documentation

The documents and instructions are available on [our website](https://web-tech-tw.github.io/arona).
26 changes: 19 additions & 7 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

To configure the Arona, you need to create a configuration file named `config.yaml` in the root directory of the project.

> **⚠️ Public Access From The Internet Required**
>
> You must fill the `baseUrl` field in the `config.yaml` file with the URL that can be accessed from the internet.
>
> Otherwise, the bridge will not work properly. (Throwing an error like `Error: Cannot check the heart code...`)
>
> If you don't have a public IP address, see the [Localtunnel](get-started#localtunnel-optional) section.
## Configuration File

The configuration file is a YAML file that contains the configuration for the Arona.
Expand All @@ -20,24 +28,24 @@ bridge:
bridgeProvider:
# OpenAI
openai:
enable: true
enable: false
# https://github.com/ai-tech-tw/openai
baseUrl: "https://web-tech-tw.eu.org/openai/v1"
apiKey: "YourGeminiApiKey"
chatModel: "gpt-3.5-turbo"

# LINE
line:
enable: true
enable: false
channelAccessToken: "YourChannelAccessToken"
channelSecret: "YourChannelSecret"
useNotify: true
useNotify: false
notifyClientId: "YourClientID"
notifyClientSecret: "YourClientSecret"

# Matrix
matrix:
enable: true
enable: false
homeserverUrl: "https://matrix.org"
accessToken: "YourSecretAccessToken"

Expand All @@ -53,6 +61,10 @@ bridgeProvider:
botToken: "YourBotToken"
```
Configuration File is related to what you want to do with Arona.
You can [enable or disable the providers you want to use](#bridgeprovider).
## Configuration Options
The configuration file contains the following options:
Expand Down Expand Up @@ -82,9 +94,9 @@ The `http` option is used to configure the HTTP server.

The `bridge` option is used to configure the bridge.

| Option | Description |
| -------- | ------------------------------------ |
| `public` | Whether the bridge is public or not. |
| Option | Description |
| -------- | ------------------------------------------------ |
| `public` | Whether the bridge can be used by public or not. |

### `bridgeProvider`

Expand Down
55 changes: 47 additions & 8 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ Arona is a simple bridge for every messenger.

It exchanges messages between LINE, Telegram, Discord, and Matrix.

## Configuration
> **⚠️ Public Access From The Internet Required**
>
> To use the bridge, it's required to make the bridge can be got public access from the internet.
>
> If you don't have a public IP address, you can use a service like [ngrok](https://ngrok.com/) or [localtunnel](#localtunnel-optional) to expose your local server to the internet.
## Quick Start

Create a `config.yaml` file in the root directory.

Expand All @@ -22,24 +28,24 @@ bridge:
bridgeProvider:
# OpenAI
openai:
enable: true
enable: false
# https://github.com/ai-tech-tw/openai
baseUrl: "https://web-tech-tw.eu.org/openai/v1"
apiKey: "YourGeminiApiKey"
chatModel: "gpt-3.5-turbo"

# LINE
line:
enable: true
enable: false
channelAccessToken: "YourChannelAccessToken"
channelSecret: "YourChannelSecret"
useNotify: true
useNotify: false
notifyClientId: "YourClientID"
notifyClientSecret: "YourClientSecret"

# Matrix
matrix:
enable: true
enable: false
homeserverUrl: "https://matrix.org"
accessToken: "YourSecretAccessToken"

Expand All @@ -57,11 +63,19 @@ bridgeProvider:
To get detailed information about the configuration, please refer to the [Configuration](./configuration.md) page.
## Installation
> **⚠️ Public Access From The Internet Required**
>
> You must fill the `baseUrl` field in the `config.yaml` file with the URL that can be accessed from the internet.
>
> Otherwise, the bridge will not work properly. (Throwing an error like `Error: Cannot check the heart code...`)
>
> If you don't have a public IP address, see the [Localtunnel](#localtunnel-optional) section.

### Installation

To run the project, you can use Docker or run it natively.

### Docker
#### Docker

Create a `docker-compose.yml` file in the root directory.

Expand All @@ -85,7 +99,7 @@ Run the following command to start the project.
docker-compose up -d
```

### Native
#### Native

Run the following commands to start the project.

Expand All @@ -102,3 +116,28 @@ Install the dependencies and start the project.
npm install
npm start
```

### Localtunnel (Optional)

If you don't have a public IP address, you can use [localtunnel](https://github.com/localtunnel/localtunnel) to expose your local server to the internet.

But when you're using [Arona with docker](#docker), it might be better to use [ngrok](https://ngrok.com/) instead of localtunnel (due to no [node.js](https://nodejs.org) required).

See the [Quickstart of ngronk](https://ngrok.com/docs/getting-started/) for more information.

To use localtunnel, run the following command in another terminal.

```sh
npx localtunnel --port 3000
```

You will get a URL like `https://your-subdomain.loca.lt`.

Fill the `baseUrl` field in the `config.yaml` file with the URL.

```yaml
http:
baseUrl: "https://your-subdomain.loca.lt"
```

Don't forget to restart the project after changing the configuration.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ hero:
features:
- title: Simplicity First
details: Minimal setup with a simple and intuitive structure that makes it easy to get started.
- title: 4 Instant Messengers Supported
details: Support for LINE, Telegram, Discord and Matrix.
- title: Mutiple Platforms
details: It supports LINE, Telegram, Discord, and Matrix.
- title: Open Source
details: The project is open source and available on GitHub.
- title: Cross-platform
Expand Down
83 changes: 79 additions & 4 deletions docs/integrations/discord.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Discord

[Discord](https://discord.com) is a communication platform that allows you to communicate with your team in real-time.

It's popular among gamers, developers, and other communities.

![Discord](../statics/brands/Discord.png)

## Introduction

The Discord integration allows you to send notifications to a Discord channel. You can use this integration to send notifications from your workflows to your Discord channel.
The Discord integration allows you to send notifications to a Discord channel.
You can use this integration to send notifications from your workflows to your Discord channel.

## Prerequisites

Expand All @@ -14,7 +21,75 @@ Before you can set up the Discord integration, you need to have the following:

## Setting up the integration

To set up the Discord integration, you need to create a webhook in your Discord channel. You can do this by following these steps:
Here will show you how to set up the Discord integration by creating a Discord bot and adding it to a channel.

### Create a Discord bot

To set up the Discord integration, you need to create a webhook in your Discord channel.
You can do this by following these steps:

1. Open [Discord Developer Portal](https://discord.com/developers).
2. Click "New Application".
3. Enter the name of your application.
4. Click "Create" and accept the terms.
5. Click on the "Bot" tab.
6. Make all of "Privileged Gateway Intents" to be "ON".
7. Here is the permissions you need to give to the bot (not minimum, but might be used in the future):
- `Add Reactions`
- `Attach Files`
- `Embed Links`
- `Read Message History`
- `Send Messages`
- `Send TTS Messages`
- `Use External Emojis`
- `Use External Stickers`
8. Click on the "Copy" button to copy the appid and token, fill in the `appId` and `botToken` fields (see the [Configure](#configure) section).
9. Go to OAuth2 tab.
10. Use the "OAuth2 URL Generator" to generate the URL with the permissions you need.
11. Open the generated URL in your browser.
12. Select the server you want to add the bot to.
13. Click "Authorize".
14. Go to the channel you're hoping to bridging it.
15. Start a chat with the bot and send a command to verify that it is working.

Here is the official documentation for creating a Discord bot: [Discord Developer Portal](https://discord.com/developers/docs/intro)

### Configure

Here are the options you can configure for the Discord integration:

| Option | Description |
| ----------------------- | --------------------------------------- |
| [`enable`](#enable) | Whether the provider is enabled or not. |
| [`appId`](#appid) | The application ID of the Discord API. |
| [`botToken`](#bottoken) | The bot token of the Discord API. |

#### `enable`

*type: `boolean`*

Whether the provider is enabled or not.

### `appId`

*type: `string`*

The application ID of the Discord API.

You should obtain this from the Discord Developer Portal.

More information can be found [here](https://discord.com/developers/docs/intro).

### `botToken`

*type: `string`*

The bot token of the Discord API.

You should obtain this from the Discord Developer Portal.

More information can be found [here](https://discord.com/developers/docs/intro).

---

1. Open your Discord channel.
2. Click on the settings icon next to the channel name.
> The copyright of the brand logos belongs to the respective brand owners.
Loading

0 comments on commit 0a10499

Please sign in to comment.