@satorijs/adapter-kook
Advanced tools
Comparing version 4.6.1 to 4.6.3
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import { Adapter, Context, Schema } from '@satorijs/core'; | ||
@@ -3,0 +2,0 @@ import { KookBot } from './bot'; |
{ | ||
"name": "@satorijs/adapter-kook", | ||
"description": "KOOK (开黑啦) Adapter for Satorijs", | ||
"version": "4.6.1", | ||
"version": "4.6.3", | ||
"type": "module", | ||
@@ -33,7 +33,7 @@ "main": "lib/index.cjs", | ||
"devDependencies": { | ||
"@cordisjs/plugin-server": "^0.2.2" | ||
"@cordisjs/plugin-server": "^0.2.3" | ||
}, | ||
"peerDependencies": { | ||
"@satorijs/core": "^4.0.0" | ||
"@satorijs/core": "^4.1.0" | ||
} | ||
} |
@@ -22,2 +22,3 @@ import { Bot, Context, Fragment, h, HTTP, Schema, Universal } from '@satorijs/core' | ||
}).extend(config) | ||
this.proxyUrls.push('https://www.kookapp.cn/') | ||
this.internal = new Kook.Internal(this.http) | ||
@@ -24,0 +25,0 @@ |
@@ -54,4 +54,4 @@ import { Context, h, MessageEncoder, Schema } from '@satorijs/core' | ||
const payload = new FormData() | ||
const result = await this.bot.http.file(src, attrs) | ||
payload.append('file', new Blob([result.data], { type: result.mime }), attrs.file || result.filename) | ||
const { data, type, filename } = await this.bot.http.file(src, attrs) | ||
payload.append('file', new Blob([data], { type }), attrs.file || filename) | ||
const { data: { url } } = await this.bot.http.post('/asset/create', payload) | ||
@@ -58,0 +58,0 @@ return url |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
219974
4633