Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
Koishi Plugin Api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
Koishi Plugin Api
Commits
71c5cb19
Commit
71c5cb19
authored
Mar 22, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readme
parent
22a83af2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
README.md
README.md
+34
-2
No files found.
README.md
View file @
71c5cb19
# koishi-plugin-api
# koishi-plugin-api
一个 Koishi 插件
。
Koishi 作为 HTTP API 的插件,提供了一个简单的 HTTP API 接口,可以轻松接入其他聊天平台
。
## 安装
## 安装
...
@@ -16,4 +16,36 @@ npm install koishi-plugin-api
...
@@ -16,4 +16,36 @@ npm install koishi-plugin-api
## 配置
## 配置
详见
`config.ts`
部分,或详见 Schema 描述配置。
*
`path`
HTTP 监听路径。
*
`token`
验证 Bearer 令牌。如果设置,则必须提供
`Authorization: Bearer <token>`
头。
## 使用
```
ts
$
curl
-
X
POST
http
:
//localhost:14514/api -d content=.help
{
"
messages
"
:[
"
当前可用的指令有:
\n
help 显示帮助信息
\n
输入“帮助 指令名”查看特定指令的语法和使用示例。
"
]}
```
### 请求参数
```
ts
export
interface
MessageBody
{
channelId
?:
string
;
guildId
?:
string
;
messageId
?:
string
;
content
:
string
;
// 消息体,必填
userId
?:
string
;
// 发送者 ID,默认为请求 IP 地址
username
?:
string
;
avatar
?:
string
;
}
```
### 返回结果
```
json
{
"messages"
:
[
"消息内容,每一栏为一条消息。"
]
}
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment