Skip to content

Commit

Permalink
📝 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
XxLittleCxX committed Jul 26, 2022
1 parent 14472b8 commit a963396
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koishi-plugin-dcqq-relay",
"version": "0.4.0",
"version": "0.4.1",
"main": "dist/index.js",
"description": "Synchronize messages between discord and qq",
"repository": "https://github.com/koishijs/koishi-plugin-dcqq-relay",
Expand Down
36 changes: 3 additions & 33 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,14 @@
# koishi-plugin-dcqq-relay

[![npm](https://img.shields.io/npm/v/koishi-plugin-dcqq-relay?style=flat-square)](https://www.npmjs.com/package/koishi-plugin-ink)
[![npm](https://img.shields.io/npm/v/koishi-plugin-dcqq-relay?style=flat-square)](https://www.npmjs.com/package/koishi-plugin-dcqq-relay)

插件用于QQ和Discord间的消息互通,开发原意为拯救[屎山](https://github.com/Teahouse-Studios/Discord-QQ-Msg-Relay)
插件用于QQ和Discord间的消息互通

## 安装
```
yarn add koishi-plugin-dcqq-relay
```

## 升级注意
`0.1.x` 升级到 `0.2.0` 有数据库表结构修改, 插件不提供旧数据的迁移

## 配置
请首先根据 [使用数据库](https://koishi.js.org/guide/database.html) 对 koishi 进行配置

配置样例如下 (非完整 koishi 用法)

``` typescript
import { apply } from 'koishi-plugin-dcqq-relay'
import * as mysql from 'koishi-plugin-mysql'

// process.env.XXX 的值请根据实际情况修改

app.plugin(mysql.apply, {
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
})

app.plugin(apply, {
relations: [{
discordChannel: process.env.CHANNEL_DISCORD,
onebotChannel: process.env.CHANNEL_ONEBOT,
discordGuild: process.env.GUILD_DISCORD,
webhookId: process.env.WEBHOOK_ID,
webhookToken: process.env.WEBHOOK_TOKEN,
}],
onebotSelfId: process.env.ONEBOT_SELFID,
discordToken: process.env.DISCORD_TOKEN
})
```
推荐使用 console 配置,如果不用 console 的话,相信你有能力看代码找到配置参数(
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export async function apply(ctx: Context, config: Config) {
let roles: Role[] = undefined
let members: Record<snowflake, GuildMember> = {}
let contents = (await Promise.all(segment.parse(meta.content).map(async v => {
console.log(v)
if (v.type === "face") {
return segment('image', { url: `https://cdn.discordapp.com/emojis/${v.data.id}` })
} else if (v.type === "file") {
Expand Down

0 comments on commit a963396

Please sign in to comment.