From 536f691ffb87addc92b1cffc6d49df1e0f03edfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=86=E3=81=95=E3=81=BF=E3=82=87=E3=82=93=28myon2019?= =?UTF-8?q?=29/mtripg6666tdr?= <56076195+mtripg6666tdr@users.noreply.github.com> Date: Wed, 18 Jan 2023 17:19:38 +0900 Subject: [PATCH] Fix: cancel timeout on disconnect --- src/Component/PlayManager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Component/PlayManager.ts b/src/Component/PlayManager.ts index af1279869..68e80b32c 100644 --- a/src/Component/PlayManager.ts +++ b/src/Component/PlayManager.ts @@ -396,6 +396,7 @@ export class PlayManager extends ServerManagerBase { } const timer = setTimeout(() => { this.off("playCalled", playHandler); + this.off("disconnect", playHandler); if(!this.isPlaying && this.server.boundTextChannel){ this.server.bot.client .createMessage(this.server.boundTextChannel, ":wave:キューが空になったため終了します") @@ -406,6 +407,7 @@ export class PlayManager extends ServerManagerBase { }, 10 * 60 * 1000); const playHandler = () => clearTimeout(timer); this.once("playCalled", playHandler); + this.once("disconnect", playHandler); // なくなってないなら再生開始! }else{ this.play();