node-karin 0.6.22 → 0.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,7 +17,7 @@ export function AdapterConvertKarin(data) {
|
|
|
17
17
|
elements.push(segment.image(i.data.url || i.data.file, { file_type: i.data.type }));
|
|
18
18
|
break;
|
|
19
19
|
case 'record':
|
|
20
|
-
elements.push(segment.
|
|
20
|
+
elements.push(segment.record(i.data.url || i.data.file, i.data.magic === 1));
|
|
21
21
|
break;
|
|
22
22
|
case 'video':
|
|
23
23
|
elements.push(segment.video(i.data.url || i.data.file));
|
package/lib/utils/init.js
CHANGED
|
@@ -201,7 +201,7 @@ export class KarinInit {
|
|
|
201
201
|
* 获取当前的包管理器 根据锁文件判断
|
|
202
202
|
*/
|
|
203
203
|
getRegistry () {
|
|
204
|
-
if (fs.existsSync('./pnpm-lock')) { return 'pnpm' }
|
|
204
|
+
if (fs.existsSync('./pnpm-lock.yaml')) { return 'pnpm' }
|
|
205
205
|
if (fs.existsSync('./yarn.lock')) { return 'yarn' }
|
|
206
206
|
if (fs.existsSync('./package-lock.json')) { return 'npm' }
|
|
207
207
|
// cnpm 没有锁文件
|
package/lib/utils/segment.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextElement, AtElement, ImageElement, FaceElement, BubbleFaceElement, ReplyElement,
|
|
1
|
+
import { TextElement, AtElement, ImageElement, FaceElement, BubbleFaceElement, ReplyElement, VideoElement, BasketballElement, DiceElement, RpsElement, PokeElement, MusicElement, WeatherElement, LocationElement, ShareElement, GiftElement, MarketFaceElement, ForwardElement, ContactElement, JsonElement, XmlElement, FileElement, ButtonElement, CustomMusicElemen, TemplateElement, ContentElement, NodeElement, KarinElement, LongMsgElement, RecordElement } from '../types/index.js';
|
|
2
2
|
export declare const segment: {
|
|
3
3
|
/**
|
|
4
4
|
* 纯文本
|
|
@@ -77,7 +77,7 @@ export declare const segment: {
|
|
|
77
77
|
* @param name - 语音名称
|
|
78
78
|
* @returns {VoiceElement} 语音元素
|
|
79
79
|
*/
|
|
80
|
-
record(file: string, magic?: boolean, md5?: string, name?: string):
|
|
80
|
+
record(file: string, magic?: boolean, md5?: string, name?: string): RecordElement;
|
|
81
81
|
/**
|
|
82
82
|
* 语音 即将废弃 请使用segment.record
|
|
83
83
|
* @param file - 语音URL或路径、Base64
|
|
@@ -87,7 +87,7 @@ export declare const segment: {
|
|
|
87
87
|
* @returns {VoiceElement} 语音元素
|
|
88
88
|
* @deprecated 即将废弃 请使用segment.record
|
|
89
89
|
*/
|
|
90
|
-
voice(file: string, magic?: boolean, md5?: string, name?: string):
|
|
90
|
+
voice(file: string, magic?: boolean, md5?: string, name?: string): RecordElement;
|
|
91
91
|
/**
|
|
92
92
|
* 视频
|
|
93
93
|
* @param file - 视频URL或路径、Base64
|
package/lib/utils/segment.js
CHANGED
|
@@ -105,7 +105,7 @@ export const segment = new (class Segment {
|
|
|
105
105
|
*/
|
|
106
106
|
record (file, magic = false, md5 = '', name = '') {
|
|
107
107
|
return {
|
|
108
|
-
type: '
|
|
108
|
+
type: 'record',
|
|
109
109
|
file,
|
|
110
110
|
magic,
|
|
111
111
|
md5,
|
|
@@ -124,7 +124,7 @@ export const segment = new (class Segment {
|
|
|
124
124
|
*/
|
|
125
125
|
voice (file, magic = false, md5 = '', name = '') {
|
|
126
126
|
return {
|
|
127
|
-
type: '
|
|
127
|
+
type: 'record',
|
|
128
128
|
file,
|
|
129
129
|
magic,
|
|
130
130
|
md5,
|