mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
chore: 移除无用代码
This commit is contained in:
@@ -95,21 +95,10 @@ export class LegacyNTEventWrapper {
|
||||
|
||||
async callNoListenerEvent<EventType extends (...args: any[]) => Promise<any> | any>(
|
||||
EventName = '',
|
||||
timeout: number = 3000,
|
||||
...args: Parameters<EventType>
|
||||
) {
|
||||
return new Promise<Awaited<ReturnType<EventType>>>(async (resolve, reject) => {
|
||||
const EventFunc = this.createEventFunction<EventType>(EventName);
|
||||
let complete = false;
|
||||
setTimeout(() => {
|
||||
if (!complete) {
|
||||
reject(new Error('NTEvent EventName:' + EventName + ' timeout'));
|
||||
}
|
||||
}, timeout);
|
||||
const retData = await EventFunc!(...args);
|
||||
complete = true;
|
||||
resolve(retData);
|
||||
});
|
||||
): Promise<Awaited<ReturnType<EventType>>> {
|
||||
const EventFunc = this.createEventFunction<EventType>(EventName);
|
||||
return EventFunc!(...args)
|
||||
}
|
||||
|
||||
async RegisterListen<ListenerType extends (...args: any[]) => void>(
|
||||
|
||||
Reference in New Issue
Block a user