node-karin 0.12.17 → 0.12.20
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.
|
@@ -206,12 +206,12 @@ export class AdapterOneBot11 {
|
|
|
206
206
|
}
|
|
207
207
|
else {
|
|
208
208
|
const content = this.KarinConvertAdapter(i.content);
|
|
209
|
-
const userId =
|
|
209
|
+
const userId = Number(i.user_id || selfUin);
|
|
210
210
|
const nickname = String(i.nickname || selfNick);
|
|
211
211
|
messages.push({ type, data: { user_id: userId, nickname, content } });
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
const params = { [messageType]:
|
|
214
|
+
const params = { [messageType]: Number(peer), messages };
|
|
215
215
|
return await this.SendApi("send_forward_msg" /* OB11Api.sendForwardMsg */, params);
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
@@ -144,9 +144,9 @@ export declare class Karin extends Listeners {
|
|
|
144
144
|
* @param event - 监听事件
|
|
145
145
|
* @param fn - 实现函数
|
|
146
146
|
*/
|
|
147
|
-
accept<T extends keyof AcceptDict>(event: T, fn: (e: AcceptDict[T]) => boolean
|
|
147
|
+
accept<T extends keyof AcceptDict>(event: T, fn: (e: AcceptDict[T]) => Promise<boolean>, options?: Options): {
|
|
148
148
|
event: T;
|
|
149
|
-
fn: (e: AcceptDict[T]) => boolean
|
|
149
|
+
fn: (e: AcceptDict[T]) => Promise<boolean>;
|
|
150
150
|
log: (id: string, text: string) => void;
|
|
151
151
|
name: string;
|
|
152
152
|
rank: number;
|
|
@@ -316,6 +316,8 @@ class PluginLoader {
|
|
|
316
316
|
/** 函数语法糖数组 */
|
|
317
317
|
if (Array.isArray(Fn)) {
|
|
318
318
|
for (const Val of Fn) {
|
|
319
|
+
if (typeof Val !== 'object' || !Val?.type)
|
|
320
|
+
continue;
|
|
319
321
|
logger.debug(`载入插件 [${plugin}]${_path ? `${common.getRelPath(_path)}` : ''}[${file}][${Val.name}]`);
|
|
320
322
|
list.push(this.cachePlugin(index, plugin, file, Val));
|
|
321
323
|
}
|