Skip to content

Commit dc930eb

Browse files
author
Marchccc
committed
no message
1 parent 9c43e65 commit dc930eb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "koishi-plugin-api-handler",
33
"description": "识别以特定前缀开头的消息,并通过POST请求调用API,将API的响应直接作为回复发送。",
4-
"version": "1.0.0",
4+
"version": "1.0.2",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
77
"files": [

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Context, Schema, Logger } from 'koishi'
22

33
export const usage = `
4-
## koishi-plugin-api-handler v1.0
4+
## koishi-plugin-api-handler v1.0.2
55
66
1. 配置API地址。
77
@@ -61,10 +61,10 @@ export function handlePrefixes(sessionContent: string, config: Config) {
6161
export function apply(ctx: Context, config: Config) {
6262
ctx.middleware(async (session, next) => {
6363
// console.log(config);
64-
// console.log(session);
65-
// console.log(session.content);
64+
console.log(session);
65+
console.log(session.event.message);
66+
console.log(session.content);
6667
let match_prefix = handlePrefixes(session.content, config)
67-
let error = null;
6868
if (match_prefix) {
6969
logger.info(match_prefix + ':' + session.content)
7070
const res = await ctx.http.post(config.api, {

0 commit comments

Comments
 (0)