crowbartools / Firebot

A powerful all-in-one bot for Twitch streamers
https://firebot.app
GNU General Public License v3.0
354 stars 100 forks source link

Command cooldown does not work with these effects [Support] #2277

Closed DontCallMeChicken closed 10 months ago

DontCallMeChicken commented 11 months ago

Help Request I don't know why, but with this command that I created with some effects, the cooldown function doesn't work. I can set whatever I want as a cooldown, the command can always be triggered. I don't know what to do now, so I'm turning to you, the nice development team.

"23e2ec70-8c84-11ee-beab-67d37708f210": {
            "active": true,
            "simple": false,
            "sendCooldownMessage": true,
            "cooldownMessage": "This command is still on cooldown for: {timeLeft}",
            "cooldown": {
                "global": 70,
                "user": 90
            },
            "effects": {
                "id": "97c07421-7e5f-434f-8a27-b88ec701d0ca",
                "list": [
                    {
                        "id": "7e8c2d50-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:customvariable",
                        "active": true,
                        "ttl": 0,
                        "name": "cmdRudel",
                        "variableData": "{\"leader\":\"$username\",\"leadercount\":0,\"pack\":[]}",
                        "effectLabel": "cmdRudel"
                    },
                    {
                        "id": "7e8c2d51-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:toggle-command",
                        "active": true,
                        "toggleType": "enable",
                        "commandType": "custom",
                        "commandId": "344dcdf0-8c84-11ee-beab-67d37708f210"
                    },
                    {
                        "id": "7e8c2d52-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:chat",
                        "active": true,
                        "chatter": "Bot",
                        "message": "$username ruft das Rudel zusammen!"
                    },
                    {
                        "id": "7e8c2d53-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:randomeffect",
                        "active": true,
                        "effectList": {
                            "list": [
                                {
                                    "id": "5ee5a2e0-8c89-11ee-beab-67d37708f210",
                                    "type": "firebot:playsound",
                                    "active": true,
                                    "soundType": "local",
                                    "volume": 3,
                                    "audioOutputDevice": {
                                        "label": "Send To Overlay",
                                        "deviceId": "overlay"
                                    },
                                    "filepath": "/home/kuckuck/Livestream/DCMC/Medien/Audio/Sound-effects/sound-trigger-bot-copies/Wolf/Ich_sehe_mich_nicht_als_Mensch-reporter-Wolfsgeheul.ogg",
                                    "effectLabel": "Otherkin"
                                },
                                {
                                    "id": "5ee5a2e1-8c89-11ee-beab-67d37708f210",
                                    "type": "firebot:playsound",
                                    "active": true,
                                    "soundType": "local",
                                    "volume": 2,
                                    "audioOutputDevice": {
                                        "label": "Send To Overlay",
                                        "deviceId": "overlay"
                                    },
                                    "filepath": "/home/kuckuck/Livestream/DCMC/Medien/Audio/Sound-effects/sound-trigger-bot-copies/Wolf/werwolf_-_seele-wolf.mp3",
                                    "effectLabel": "Wolfsgeheul"
                                }
                            ],
                            "id": "5ad28ba0-8c89-11ee-beab-67d37708f210"
                        },
                        "effectLabel": "Woelfe-Random"
                    },
                    {
                        "id": "7e8c2d54-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:delay",
                        "active": true,
                        "delay": "50"
                    },
                    {
                        "id": "608afc30-8c8e-11ee-beab-67d37708f210",
                        "type": "firebot:randomeffect",
                        "active": true,
                        "effectList": {
                            "list": [
                                {
                                    "id": "fab3b920-8c87-11ee-beab-67d37708f210",
                                    "type": "firebot:playsound",
                                    "active": true,
                                    "soundType": "local",
                                    "volume": 4,
                                    "audioOutputDevice": {
                                        "label": "Send To Overlay",
                                        "deviceId": "overlay"
                                    },
                                    "filepath": "/home/kuckuck/Livestream/DCMC/Medien/Audio/Sound-effects/sound-trigger-bot-copies/hen2-normalisiert.mp3",
                                    "effectLabel": "Hen-gegacker",
                                    "waitForSound": false
                                },
                                {
                                    "id": "cb637d80-8c88-11ee-beab-67d37708f210",
                                    "type": "firebot:playsound",
                                    "active": true,
                                    "soundType": "local",
                                    "volume": 1,
                                    "audioOutputDevice": {
                                        "label": "Send To Overlay",
                                        "deviceId": "overlay"
                                    },
                                    "filepath": "/home/kuckuck/Livestream/DCMC/Medien/Audio/Sound-effects/sound-trigger-bot-copies/240231__bukac2__crow-of-cock.wav",
                                    "effectLabel": "Kikeriki-240231__bukac2__crow-of-cock.wav",
                                    "waitForSound": false
                                },
                                {
                                    "id": "e3313d80-8c88-11ee-beab-67d37708f210",
                                    "type": "firebot:playsound",
                                    "active": true,
                                    "soundType": "local",
                                    "volume": 2,
                                    "audioOutputDevice": {
                                        "label": "Send To Overlay",
                                        "deviceId": "overlay"
                                    },
                                    "filepath": "/home/kuckuck/Livestream/DCMC/Medien/Audio/Sound-effects/sound-trigger-bot-copies/Kikeriki/werwolf_-_tag-gockel.mp3",
                                    "effectLabel": "Kikeriki-werwolf_-_tag-gockel.mp3",
                                    "waitForSound": false
                                }
                            ],
                            "id": "f5f8f030-8c87-11ee-beab-67d37708f210"
                        },
                        "dontRepeat": true,
                        "effectLabel": "Huehner"
                    },
                    {
                        "id": "7e8c2d55-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:chat",
                        "active": true,
                        "chatter": "Bot",
                        "message": "me schließt sich $customVariable[cmdRudel, leader] an und gackert mit!",
                        "effectLabel": "Peter_Hahn"
                    },
                    {
                        "id": "7e8c2d56-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:delay",
                        "active": true,
                        "delay": "5"
                    },
                    {
                        "id": "7e8c2d57-8c8c-11ee-beab-67d37708f210",
                        "type": "ebiggz:enhanced-tts",
                        "active": true,
                        "volume": 10,
                        "voiceName": "Vicki",
                        "voiceMode": "selected",
                        "audioOutputDevice": {
                            "label": "SoftwareAudio1",
                            "deviceId": "9072af3be80c5af457269ae9c21c988e1f1f1f458677b3b5e0400929352542dd"
                        },
                        "text": "Aaaah Uuuuh!"
                    },
                    {
                        "id": "7e8c2d58-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:chat",
                        "active": true,
                        "chatter": "Bot",
                        "message": "…und Vicki ist auch mit dabei!",
                        "effectLabel": "Vicki"
                    },
                    {
                        "id": "7e8c2d59-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:delay",
                        "active": true,
                        "delay": "5"
                    },
                    {
                        "id": "7e8c2d5a-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:toggle-command",
                        "active": true,
                        "toggleType": "disable",
                        "commandType": "custom",
                        "commandId": "344dcdf0-8c84-11ee-beab-67d37708f210"
                    },
                    {
                        "id": "7e8c2d5c-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:chat",
                        "active": true,
                        "chatter": "Bot",
                        "message": "Das Rudel um $customVariable[cmdRudel, leader] hat sich erst einmal „ausgeheult“$if[$arrayLength[$customVariable[cmdRudel, pack]] == 0, ., : $arrayJoin[$customVariable[cmdRudel, pack], \", \"].] $if[$customVariable[cmdRudel, leadercount] > 0, $customVariable[cmdRudel, leader] hat $customVariable[cmdRudel, leadercount] mal das Rudel angefeuert!]"
                    },
                    {
                        "id": "7e8c2d5b-8c8c-11ee-beab-67d37708f210",
                        "type": "firebot:customvariable",
                        "active": true,
                        "ttl": 1,
                        "name": "cmdRudel",
                        "variableData": "",
                        "effectLabel": "cmdRudel"
                    }
                ]
            },
            "restrictionData": {
                "restrictions": [],
                "mode": "any",
                "sendFailMessage": true,
                "failMessage": "Sorry, you cannot use this command because: {reason}",
                "useCustomFailMessage": false
            },
            "aliases": [],
            "sortTags": [
                "251211be-af1c-458a-91ea-0bc5fd39bdef"
            ],
            "treatQuotedTextAsSingleArg": false,
            "trigger": "!rudel",
            "id": "23e2ec70-8c84-11ee-beab-67d37708f210",
            "createdBy": "dontcallmechicken",
            "createdAt": "2023-11-26T18:49:26+01:00",
            "count": 64,
            "lastEditBy": "dontcallmechicken",
            "lastEditAt": "2023-11-26T23:00:16+01:00",
            "useCustomCooldownMessage": false,
            "description": "Das ist keine Beschreibung!"
        },
DontCallMeChicken commented 11 months ago

I have now found the cause: It is due to the “Toggle Command” effect. If this is activated, the cooldown does not work. As soon as I deactivate or delete the effect, the cooldown works. And only the first effect that activates the other command. The "Toggle Command" effect at the end of the effect list, which deactivates the other command again, does not prevent a cooldown.

Since this command is used to activate the other command for a certain time, but this doesn't work now, the whole thing doesn't work for me.

I also assume that this is not what the developers intended and therefore it is a bug.

CKY- commented 11 months ago

@DontCallMeChicken

I have now found the cause: It is due to the “Toggle Command” effect. If this is activated, the cooldown does not work. As soon as I deactivate or delete the effect, the cooldown works. And only the first effect that activates the other command. The "Toggle Command" effect at the end of the effect list, which deactivates the other command again, does not prevent a cooldown.

Since this command is used to activate the other command for a certain time, but this doesn't work now, the whole thing doesn't work for me.

I also assume that this is not what the developers intended and therefore it is a bug.

what version of firebot?

DontCallMeChicken commented 11 months ago

@CKY-

what version of firebot?

Firebot v5.58.1 OS Ubuntu 20.04.6 LTS

zunderscore commented 10 months ago

This is an issue related to the way we currently refresh the command cache after modifying commands (including their enabled state). Folding this into #1947.