Custom chat triggers in Streamer bot

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video a way to enable custom triggers so they don't react like a normal command it could react to a emote it could be part of a sentence [Music] what do you think of this you like it excuse us please sure talk amongst yourself hello and welcome to stream robot bites where i cover how to set up and to make the most of the awesome stream robot there is one video per topic to make it easy as possible to follow and find when relevant sample import code will be provided to make it even easier for you to get started and add functionality to your stream so let's get started with a topic for this video so to set up the custom trigger copy the import code from the description below go to your streamer bot and click on import [Music] paste in the import string and you'll see there's an action and no command you can import this multiple times and get multiple copies of it because you may want to have multiple custom triggers so i'm going to import that and we'll see it here is the action what you do need to set is a trigger name this means that the cues for the triggers to do the counts are going to be separate from each other but if you want to have certain triggers to have the certain shared queue names you could use the same name if you want to you can then define the number of times the command needs to be used in the time frame and the time frame in seconds so by default it's five times in 30 seconds then you have a cooldown so that cooldown will decide how long you need to wait after it's been triggered once before it can trigger again by default this is 35 seconds you might well want this to be larger you got the code then or she'll decide whether to say okay have a meta trigger or not if it doesn't then it doesn't continue the code but if you have met that trigger you'll do the message so this could be something from playing a video or maybe doing a snap camera filter so you could have emotes in chat triggering a filter and snap camera which matched the emotes and this is what's currently being used for so we've got the actions set up at this point you then need to set a command up so in my example i use beetlejuice now the difference with this trigger you don't generally put it at the start you put it anywhere because it can be anywhere in a sentence if it's an emote for example typically isn't at the start we let anyone use it so default permissions are good we select the custom command trigger or you can rename it for each one you want to run global cooldown this is important especially if you have busy chat you can take this off if it's not too busy in your chat but if you have a lot going on i'd highly recommend it so you need to have it in five separate seconds for example or however many times you've set so it can only be triggered once per second and there you go that's it set up so if beetlejuice is run anywhere in a command it's going to run the custom command trigger that's going to make sure it hits a number of times in the number of seconds before it does the actions that you declare now the optional part of running through the code so we've talked about the arguments already and the message that you set here and again this could really be anything you want it could be an audio clip it could be various things so rather than having just one person to trigger it you need multiple people so the execute code what do we do here so we look at the pulling the values in we declare so the number of seconds that we have to do the actions the number of times we need to hit that and a cooldown we then have the last trigger name and we also have last as a timer rating so the last trigger is going to be the last time it was triggered and so we can then know if it's cool down or not that's what that's used for the time array name that's going to be the name which need to be custom that's why we have the name path in there which we're going to add the trigger name and this will store a list of the times it's been called in in sort of a number format in seconds so what we do is we get the last trigger from this last trigger name and look at the name time so number time in seconds now is a large number from uh unix time seconds which is 1970 somewhere uh 1970 something somewhere and we then look if the last trigger is um not equal to one which it starts off as we then look at the last trigger plus cooldown is greater than no time and it's too soon to trigger again so we'll return false otherwise we get the last trigger name we set that to b1 you then have a time array which is a list of numbers basically these seconds again we look at um if it's the last trigger has not been set we then basically set things up for use here and what we do is build done is false and we basically check as long as we go through the time array and we've not told it to finish we go through and we look at comparing them if it's the time array is um plus 30 seconds i need to change that for google live because that wouldn't need to be the cooldown is less than the night time then we will set that to be in no time and because that is not within the threshold we set the done to true so this means it's not going to continue through that loop because it's not worthwhile checking the rest of the array what we then do is create a new array and so if it's not done as in it's gone through the list we can then look at the having a new array so we go through and we basically increase the length of that and we then compare that to a number of times so if we've basically hit the threshold so we've triggered that so we can clear that array we can set that time array and then we can do the last trigger time as well so we know not to run again for the cooldown time so if we're done we stop reset the global variables of the time array if it's not done then we use the new array please like and subscribe to be notified of more videos like this if there's a topic you like covered please do let me know in the comments or on discord check out my twitch stream to see the bot in action and for other examples the links to my twitch social media and streaming bots can be found at vrflat.com additional links to others that provide stream robot content can be also found in the description finally thank you net for making a great bot and please consider supporting us patreon which is linked from streamer dot bot
Info
Channel: VRFlad
Views: 5,441
Rating: undefined out of 5
Keywords: #StreamingTips, #StreamerBot, #OBS, #SLOBS, #twitch bot, #live streaming, #twitch
Id: 4hEnnuNtVAE
Channel Id: undefined
Length: 8min 37sec (517 seconds)
Published: Thu Jun 23 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.