From 2cfc7c98349d438f8ffd1f8201b6c76a3ef3b932 Mon Sep 17 00:00:00 2001 From: xswl Date: Tue, 5 Sep 2023 23:03:46 +0800 Subject: [PATCH] rename --- src/discord.ws.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/discord.ws.ts b/src/discord.ws.ts index bff1dfc..6c53fb6 100644 --- a/src/discord.ws.ts +++ b/src/discord.ws.ts @@ -349,6 +349,7 @@ export class WsMessage { }); this.log("appeal.httpStatus", httpStatus); if (httpStatus == 204) { + //todo this.on(newnonce, (data) => { this.emit(nonce, data); }); @@ -646,17 +647,17 @@ export class WsMessage { this.waitMjEvents.set(nonce, { nonce, prompt, - onmodal: async (nonce, id) => { + onmodal: async (oldnonce, id) => { if (onmodal === undefined) { // reject(new Error("onmodal is not defined")) return ""; } - var nonce = await onmodal(nonce, id); + var nonce = await onmodal(oldnonce, id); if (nonce === "") { // reject(new Error("onmodal return empty nonce")) return ""; } - this.removeWaitMjEvent(nonce); + this.removeWaitMjEvent(oldnonce); this.waitMjEvents.set(nonce, { nonce }); this.onceImage(nonce, handleImageMessage); return nonce;