Skip to content

Commit

Permalink
add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Dec 26, 2024
1 parent cc85116 commit 808988e
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 50 deletions.
25 changes: 25 additions & 0 deletions .vitepress/theme/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,28 @@ blockquote.route {
.vp-doc sup a {
text-decoration: none;
}

.adapter-table {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem 1rem;

a.adapter {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 4rem;
border-radius: 12px;
background-color: var(--vp-c-bg-soft);
transition: all 0.3s ease;
text-decoration: none;
color: var(--vp-c-text);
cursor: pointer;
user-select: none;
}

.adapter:hover {
background-color: var(--vp-c-bg-alt);
}
}
30 changes: 30 additions & 0 deletions en-US/introduction.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# Introduction

Satori is a universal chat protocol. We aim for Satori to bridge the differences between various chat platforms, enabling developers to create cross-platform, scalable, and high-performance chat applications at a lower cost.

The name "Satori" is inspired by the character Komeiji Satori from the game Touhou Project. Komeiji Satori can communicate with various animals through telepathy, and this name was chosen in the hope that Satori can serve as a bridge between different chat platforms.

The Satori development team has long been engaged in chatbot development and is familiar with the communication methods of various chat platforms. After four years of development, Satori has a robust design and mature implementation. Currently, Satori officially provides adapters for over 15 chat platforms, fully covering the world's mainstream chat platforms:

<div class="adapter-table">
<a class="adapter">DingTalk</a>
<a class="adapter">Discord</a>
<a class="adapter">KOOK</a>
<a class="adapter">Lark</a>
<a class="adapter">LINE</a>
<a class="adapter">Email</a>
<a class="adapter">Matrix</a>
<a class="adapter">QQ</a>
<a class="adapter">Slack</a>
<a class="adapter">Telegram</a>
<a class="adapter">WeChat Official Account</a>
<a class="adapter">WeCom</a>
<a class="adapter">HoYoLAB</a>
<a class="adapter">WhatsApp</a>
<a class="adapter">Zulip</a>
</div>

These adapters not only provide an out-of-the-box experience but also practically demonstrate the universality and extensibility of the Satori protocol.

You don’t need to worry about losing control over chat platforms when using Satori. Thanks to Satori’s internal interface mechanism, you can write generic code in most cases and use internal interfaces to implement platform-specific features when needed.

Additionally, Satori offers a complete solution for large-scale scenarios. Whether it’s a chatbot on a personal computer or a chat platform backend on a distributed cluster, Satori can meet your needs.
81 changes: 73 additions & 8 deletions en-US/resources/channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,97 @@

## Definition

### Channel
### Channel {#def-channel}

| FIELD | TYPE | DESCRIPTION |
| ----- | ---- | ----------- |
| id | string | channel ID |
| name | string | channel name |
| type | [ChannelType](#channeltype) | channel type |
| name | string? | channel name |
| parent_id | string? | parent channel ID |

### ChannelType

| 名称 || 描述 |
| --- | --- | --- |
| TEXT | 0 | text channel |
| DIRECT | 1 | direct message channel |
| CATEGORY | 2 | category channel |
| VOICE | 3 | voice channel |

## API

### Get Channel
### Get Guild Channel {#api-channel-get}

- <badge>POST</badge> `/v1/channel.get`
> <badge>POST</badge> `/channel.get` {.route}
| FIELD | TYPE | DESCRIPTION |
| ----- | ---- | ----------- |
| channel_id | string | channel ID |

Get a channel by ID. Returns a [channel](#channel-1) object.
Get a channel by ID. Returns a [Channel](#def-channel) object.

### bot.getChannelList(guildId, next?)
### Get Guild Channel List {#api-channel-list}

- <badge>POST</badge> `/v1/channel.list`
> <badge>POST</badge> `/channel.list` {.route}
| FIELD | TYPE | DESCRIPTION |
| ----- | ---- | ----------- |
| guild_id | string | guild ID |
| next | string | pagination token |

Get channels in a guild. Returns a [list](../protocol/api.md#pagination) of [channel](#channel-1) objects.
Get all channels in a guild. Returns a [List](../protocol/api.md#list) of [Channel](#def-channel) objects.

### Create Guild Channel {#api-channel-create}

> <badge>POST</badge> `/channel.create` {.route}
| FIELD | TYPE | DESCRIPTION |
| --- | --- | --- |
| guild_id | string | guild ID |
| data | [Channel](#def-channel) | channel data |

Create a guild channel. Returns a [Channel](#def-channel) object.

### Update Guild Channel {#api-channel-update}

> <badge>POST</badge> `/channel.update` {.route}
| FIELD | TYPE | DESCRIPTION |
| --- | --- | --- |
| channel_id | string | channel ID |
| data | [Channel](#def-channel) | channel data |

Update a guild channel.

### Delete Guild Channel {#api-channel-delete}

> <badge>POST</badge> `/channel.delete` {.route}
| FIELD | TYPE | DESCRIPTION |
| --- | --- | --- |
| channel_id | string | channel ID |

Delete a guild channel.

### Mute Guild Channel <badge type="warning">Experimental</badge> {#api-channel-mute}

> <badge>POST</badge> `/channel.mute` {.route}
| FIELD | TYPE | DESCRIPTION |
| --- | --- | --- |
| channel_id | string | channel ID |
| duration | number | mute duration (in milliseconds) |

Mute a guild channel. If the duration is set to 0, it will unmute the channel.

### Create Direct Message Channel {#api-user-channel-create}

> <badge>POST</badge> `/user.channel.create` {.route}
| FIELD | TYPE | DESCRIPTION |
| --- | --- | --- |
| user_id | string | user ID |
| guild_id | string? | guild ID |

Create a direct message channel. Returns a [Channel](#def-channel) object.
50 changes: 36 additions & 14 deletions en-US/resources/guild.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,62 @@

## Definition

### Guild
### Guild {#def-guild}

| FIELD | TYPE | DESCRIPTION |
| ----- | ---- | ----------- |
| id | string | guild ID |
| name | string | guild name |
| name | string? | guild name |
| avatar | string? | guild avatar |

## API

### bot.getGuild(guildId)
### Get Guild {#api-guild-get}

- <badge>POST</badge> `/v1/guild.get`
> <badge>POST</badge> `/guild.get` {.route}
| FIELD | TYPE | DESCRIPTION |
| ----- | ---- | ----------- |
| guild_id | string | guild ID |

Get a guild by ID. Returns a [guild](#guild-1) object.
Get a guild by ID. Returns a [Guild](#def-guild) object.

### bot.getGuildList(next?)
### Get Guild List {#api-guild-list}

- <badge>POST</badge> `/v1/guild.list`
> <badge>POST</badge> `/guild.list` {.route}
| FIELD | TYPE | DESCRIPTION |
| ----- | ---- | ----------- |
| next | string | pagination token |

Get guilds where the current user is a member. Returns a [list](../protocol/api.md#pagination) of partial [guild](#guild-1) objects.
Get guilds where the current user is a member. Returns a [List](../protocol/api.md#list) of partial [Guild](#def-guild) objects.

### bot.handleGuildRequest(messageId, approve, comment?)
### Handle Guild Invitation {#api-guild-approve}

- **messageId:** `string` 请求 ID
- **approve:** `boolean` 是否通过请求
- **comment:** `string` 备注信息
- 返回值: `Promise<void>`
> <badge>POST</badge> `/guild.approve` {.route}
处理来自群组的邀请。
| FIELD | TYPE | DESCRIPTION |
| --- | --- | --- |
| message_id | string | request ID |
| approve | boolean | whether to approve the request |
| comment | string? | comment |

Handle an invitation from a guild.

## Events

### guild-added

Triggered when joining a guild. Required resource: `guild`.

### guild-updated

Triggered when a guild is modified. Required resource: `guild`.

### guild-removed

Triggered when leaving a guild. Required resource: `guild`.

### guild-request

Triggered when receiving a new guild invitation. Required resource: `guild`.
27 changes: 0 additions & 27 deletions zh-CN/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,6 @@ Satori 的开发团队长期从事聊天机器人开发,熟悉各种聊天平
<a class="adapter">Zulip</a>
</div>

<style lang="scss">
.adapter-table {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem 1rem;

a.adapter {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 4rem;
border-radius: 12px;
background-color: var(--vp-c-bg-soft);
transition: all 0.3s ease;
text-decoration: none;
color: var(--vp-c-text);
cursor: pointer;
user-select: none;
}

.adapter:hover {
background-color: var(--vp-c-bg-alt);
}
}
</style>

这些适配器不仅为你带来了开箱即用的体验,也从实际上证明了 Satori 协议的通用性和扩展性。

不必担心使用 Satori 后会失去对聊天平台的控制。得益于 Satori 的内部接口机制,你完全可以大多数情况下编写通用代码,并在需要的时候使用内部接口来实现平台特定功能。
Expand Down
2 changes: 1 addition & 1 deletion zh-CN/resources/guild.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
| --- | --- | --- |
| message_id | string | 请求 ID |
| approve | boolean | 是否通过请求 |
| comment | string | 备注信息 |
| comment | string? | 备注信息 |

处理来自群组的邀请。

Expand Down

0 comments on commit 808988e

Please sign in to comment.