Enhanced giveaway system for Streamer bot!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this episode of stream of hot bites we have a giveaway coat which can be used by potentially multiple times you can then check the entries that you have it within the giveaway and finally and of course pick the giveaway winner [Music] hello and welcome to stream robot bytes 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 to get started and to add functionality to your stream let's get started with the topic for this video so importing the actions into stream bot is easy use right click in action section select import and we paste in a string from the video description below you may need to remove a space if you don't uh copy it just right and once you do that we can import those it's worth noting these actions do have a cue and cues that block are recommended for actions that are working with files where you should only have one action running at a time so now we've got four actions here of which you'll set up three commands for so the actions that we have the first one is enter giveaway that's just a standard giveaway entry it can be called multiple times so we'll control it by either something like channel point rewards or a command that has a cooldown you've also got the end giveaway with one entry only so this actually will limit the number of times you can enter a giveaway so this is just a single time so you could run this for a month for example knowing that only people can enter this once you've got a check entries and that's for the multiple entry um give up uh giveaway so that will notify the viewer that they have a certain number of entries and finally we have a a giveaway winner so uh whenever the viewer as whatever the winner has been picked it will remove all entries from the file of that winner so we didn't get multiple entries if it's multiple prizes being won so it makes it a bit fairer that way so that's what these actions do let's uh set up commands for them in a moment but we'll just go through and we'll configure them so what you need to do for these is you need to point it to text file that exists so for me this does exist it's my c drive stream stuff giveaway.txt file and giveaway you set the file here and what it's just doing is when you do put things into place and select the file you may need to create a file i would typically actually remove that file afterwards because it can give an empty entry on the first entry of the list this one has it in two places so do be aware of that so the first one here is just the free form which you can change in here and the second one is picking the file again again it's the same file [Music] find the giveaway winner is just this location [Music] so the actions we need to point it at the text file we're using for this specific giveaway you can have a duplicate um giveaways running parallel you just need different text files it points at and different action names so you just copy them or import again it'll put a copy on so to set up the commands right click on the blank area select add first one we want to put in here is enter giveaway now as i said earlier on the video this is a key place you can do to select a cooldown now you could use uh instead of a command you could use a channel point reward here and to maybe allow one pers uh one per you know certain entries per stream per user but um or points or something like that so you limit it by points so anyway we're going to use a command here using enter giveaway and the action is end to give away now we could use the one-time entry but we'll set up two commands for this even though it's the same file just to show how it works um so then to give away we're going to leave no call down just for testing just to show how the basic command will work next up is the check entries [Music] so that's going to be check entries there that's fine it doesn't really matter you know cool down that either because it doesn't actually change the giveaway it just notifies user how many entries they have and get giveaway winner and we need these moderators there that's also important one to uh make sure that's not picked by users what we're going to do here is we're going to do a one type entry and there we go the commands are all set up and we're ready to test so for testing we have the broadcaster account on the left hand side of my boss account on the right hand side so we can show how it works with multiple users so i'm going to try showing you first the one time entry first so that's we should only be able to enter that once so broadcaster account enters that we try again it's already notifying as we have entered that giveaway on the bot account again that's only allowed and enter it once we can still use the check entries command it doesn't really benefit as much for this type of giveaway so again just picking up a single entry now of course if we're using a regular giveaway so maybe we have a cooldown on the command so we can only enter once per hour for example you can have multiple entries so you put in a few there and we can see now three entries in the giveaway and the bots still will leave with one okay now the exciting time to pick the winner so if you do a giveaway winner you can see that my broadcaster account is a winner what's really interesting here though is it's removed my entries all three of them the bot still has its one entry so if we don't pick a second winner is going to pick the bot now for the optional part to go through the actions and to explain what each part is doing let's start with empty giveaway this is the simplest action we have here we are writing just the name of the user to a text file [Music] we're then notifying to chat that we've entered the giveaway test that has no prizes the check entries i will cover next we need to set the text file here because we have code and i don't want to suggest people to have to execute code here so once you set this argument the code here is going to pull that argument into something called giveaway file it's also going to pick out the user so it's got a variable called user from the actual user that's triggered that command checking entries what it does now is it will look at each file uh each line in the file of the giveaway file again giveaway file is here which is referenced from the arguments which is then from the action above if the line reads in matches the user account we put an increment on a counter this counter plus means put plus one on that and it starts off as zero up here we then set the argument called entries count to a string which we can then use outside of this to say user you have these number of entries into the test giveaway so i've done enter giveaway and check entries i'm going to show you the one entry only which is similar to the to both these actions it's kind of like a merger than both again it sets argument the code now instead of doing a count it looks just for any occurrence if we hit occurrence they'll say you've already entered that giveaway and then return false means stop all processing of the action so what will happen if it's been entered already it's gonna run that code and it's going to stop otherwise just like the regular check and giveaway it will write to the file and notify the user you've been entered finally the giveaway winner we go into the file called giveaway.text we read a random line from that we execute the code i'll get into that in a moment and you send a message to saying who is the winner so what we do again we are going through into the into the file and we are telling it giveaway file here the winner is instead of the user it's a random line we've pulled in and what we do rather than counting the entries is if the line is um not the winner we write that file to a new temporary file so we've got a temporary file here which is created just by a random this action will give us a random uh temporary file so as we're reading through the giveaway file we're creating a new temporary file and so what we're doing is that temporary files can have every entry where the line is not the winner we then delete the original giveaway file and then we move the temporary file to the giveaway file and that's then the explanation of these actions please like and subscribe to be notified of more videos like this if there's a topic you like covered please let me know in the comments or also on discord check my twitch stream to see the bottom action and for other examples so the links to my twitch social media and just drew robot can be found at vrflat.com additional links to others that provide streamer bot content can be found in the description too finally thank you so much to nate for making a great box please do consider supporting his patreon which is linked from streamr.bot
Info
Channel: VRFlad
Views: 3,243
Rating: undefined out of 5
Keywords: #StreamingTips, #StreamerBot, #OBS, #SLOBS, #twitch bot, #live streaming, #twitch
Id: 38m0R9ZI5F0
Channel Id: undefined
Length: 12min 46sec (766 seconds)
Published: Mon Jan 03 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.