From 17bcec2f0d435d3e60d82f4513cb19c29c982e19 Mon Sep 17 00:00:00 2001 From: Lluis Date: Tue, 14 May 2024 18:29:41 +0200 Subject: [PATCH] fix deactivate command --- handlers/tempsDeFlors.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/handlers/tempsDeFlors.js b/handlers/tempsDeFlors.js index b15e8b7..005e6a3 100644 --- a/handlers/tempsDeFlors.js +++ b/handlers/tempsDeFlors.js @@ -50,9 +50,9 @@ class TempsDeFlors { } async setDeactivate (target, bot) { - const oldActiveSpot = await TwitchService.setActiveSpot(0) - if (oldActiveSpot !== 0) { - bot.say(target, `Punto ${oldActiveSpot} desactivado.`) + const channelBeforeUpdate = await TwitchService.setActiveSpot(0) + if (channelBeforeUpdate && channelBeforeUpdate.activeSpot !== 0) { + bot.say(target, `Punto ${channelBeforeUpdate.activeSpot} desactivado.`) } }