Easy % Chat Commands with Nightbot
Вставка
- Опубліковано 26 тра 2023
- Let’s talk about those percent-based commands that people have all the time on their twitch channels.
In other people’s chats, I've had these commands tell me how sweet I am, how wicked, how smelly, how lucky, etc.
The idea is that users type the command and then nightbot generates a random number and uses that as part of the output.
It’s very simple and very fun, and is a great little engagement tool to give people something to do in chat during lulls in conversation, and when one user uses this command, it often results in a whole bunch of users trying it out too, which is always fun.
For your copy/pasta needs, here's the message for the given example:
$(user) is $(eval Math.floor(Math.random()*100))% chaotic.
🔥 Subscribe here! bit.ly/phlare_subscribe
🔴 Watch Phlare Live: bit.ly/phlare_twitch
===== Quick Links =====
More Nightbot Guides: • Nightbot
📼 More Streamer Tutorials: bit.ly/phlare_tutorials
🤖 Streamer.bot software: streamer.bot/
➤ OBS Studio: obsproject.com/
♪ Epidemic Sound - Royalty Free Music + SFX: bit.ly/phlare_es
===== Socials =====
🔥 Join Phlare's Discord: bit.ly/phlare_discord
👕 Phlare's Merch: bit.ly/phlare_shop
👑 Phlare's Throne Wishlist: bit.ly/phlare_throne
🐦 Twitter: bit.ly/phlare_twitter
🗪 Phlare's other socials: bit.ly/phlare_linktre
===== Affordable Streaming Gear for Beginners* =====
🎥 Elgato FaceCam: amzn.to/3KDqJjb
🎤 HyperX Solocast: amzn.to/3ONUD6F
🎤 Cheap Boom Arm: amzn.to/47pwYRf
🎤 Pop Filter for Mic: amzn.to/3DTWcKe
🚨 Programmable RGB Floodlights: amzn.to/3QS6pP5
*As an Amazon Associate I earn from qualifying purchases.
Music provided by Monstercat:
Nigel Good - Cine
/ monstercatsilk - Навчання та стиль
I'm 100% happy you watched my video. Let me know what you make with this!
check out my growing Nightbot playlist here: ua-cam.com/play/PLYmGgQAaCW_9XCY7375LBb-RBFFkf3bXn.html
i am just curious, can you copy paste the command?
@CocaineForKids it’s in the description if you need it, is that what you mean?
well can u uhm place the command into comments so i can copy paste it and edit it by myself
oh ok @@Phlare
$(user) is $(eval Math.floor(Math.random()*100))% chaotic.
amazing as always, my friend!
Thanks bud
underrated, great video!
Thank you
thank youuu sm ! 🙂
Hey Phlare, thank you for the awesome videos! I was wondering is it possible to mix the ''% chat command'' with the ''forest'' command? As I was thinking of an idea which would be users/chatters doing ''!bean'' command and have it randomly pick and say ''user is a cool bean!'' or ''user is a good bean''. Would that be possible?
Yup, totally possible. What other adjectives would you like other than good and cool?
$(user) is a $(eval const adj = ['good','smart','spicy','cool']; adj[Math.floor(Math.random() * adj.length)];) bean.
Can add as many adjectives as you want as long as the whole thing stays under the character limit for nightbot, which I think is 500
@@Phlare That's amazing thank you so much! I can add the other variations myself. I just struggled to figure out how to combine the commands.
@aveana oh did you want a % in there somewhere too?
would it be possible to use the random generated % command to generate a number then play a corrosponding video based on the % of the output?
for example if % is between 1-20 play video A if 21-40 play video b, so on and so forth?
with nightbot? no I don't think it's possible to play a video at all with nightbot, let alone do it randomly like this.
this would be something that could be done fairly easily with streamer.bot though.
best i could do with nightbot would be outputting a video link based on random chance.
@@Phlare well what if it plays the video via a !command ? set the bot as a Mod that can activate mod only !commands? if it could be done with streamer bot how would that be set up?
❤❤ welcome 👍
love this tutorial! so simple
i was just wondering though if there’s a way to do it so it gives a user a random animal? so like “testuser your woodland creature is a fox” sorry for the odd question or if it doesn’t make sense.
I do understand the question. I could do this easily with streamer bot but I’m not sure offhand if it is possible with nightbot. I’ll have to play around a bit and get back to you.
ok this is definitely possible, but it's not pretty.
here you go!
$(user) your woodland creature is a $(eval const animals = ['fox','bear','opossom','owl','skunk','raccoon']; animals[Math.floor(Math.random() * animals.length)];)
@@Phlare wow thank you so much! you're a great help.
@@Phlare This is super awesome! I modified this string and now people can type !faction in my chat to see what Marvel team they've been recruited to (X-Men, Avengers, Fantastic Four, etc)
@@parrymanilow nice one
If you use a different percentage, such as 500, would it go up to 500 instead
Yup!
hello I am trying to make a "!sue" command and I want it to pick one of the two users on random ( $(user), $(touser)). how can I have it output like that?
Like a user will use the command targeting someone else, and one of the two will be chosen randomly as part of the output?
try something like this:
$(user) sues $(touser) and the court decides in the favor of $(eval const users = ["@$(user)", "@$(touser)"]; users[Math.floor(Math.random() * users.length)];)
hi, how do i make it so nightbot would say "odds of (users message) are x%" im trying to setup an !odds command and i want the message to be said in the command
just wanted to expand on this, the user would say something like "!odds getting a gf" or smth and then nightbot would say "odds of getting a gf are x%"
You can use $(query) to repeat the user’s input after the command.
So this would be something like “Odds of $(query) are $(eval Math.floor(Math.random()*100))%”
Might need to fix spacing and stuff because copy/paste goes crazy sometimes
@@Phlare ty!
Hello! How do I do something like !happy @user
When I tag someone, It says my own name and not the user I was tagging.
Thank you!
You want to use $(touser) instead of $(user) if you want to use the target’s name and not the person who types the command
@@Phlare thank you so much!!!
How to add a voting system
What kind of voting are you thinking of? Can’t you use the native polls in twitch for this?
is there one to change from percentage to cm?
Sure, I mean you would just replace the % sign with cm and adjust the wording otherwise.
What would you like it to say and what range of values are you looking for?
i guess 0-200cm @@Phlare
So you just need to change the 100 in the code above to 200 and then change the % at the end to cm.
Then you can just adjust the words at the front to fit your needs
Thanks so much! You rock! @@Phlare
I got a warning for saying !subcount lol
Whaaa?
Math not defined coming😢
must be a copy/paste issue. maybe you have an extra space or something?
$(user) is $(eval Math.floor(Math.random()*100))% chaotic.
Mobile tutorials please
can you expand on what you mean by this?
Hi! I was wondering if there's a way for the bot to grab a random video from a playlist? I've been trying to figure it but I'm not totally sure how
This is the code I'm working with: $(eval a=`$(urlfetch jsonua-cam.com/play/PLe4N4e5RkGUSiYytrFVUFwXCgZy4VKHq7.html)`.split(`|`);a[Math.floor(Math.random()*a.length)])
Hmm. I will have to play with it and see what I can see. Depends on what gets returned by the URL
I think the main issue here is that the urlfetch feature in nightbot requires a response from the URL in either plain text or as a json response, so in this case it won't work.
could probably get complex and do it through the google api somehow, or maybe there is a third party service that'll do it for us. lemme do a quick search, but i'm hitting a wall so far.
I think what you have would work if the URL returned JSON
If nothing else, you could do this more manually.
manually enumerate the URLS of each video in the playlist and make a command like this:
i took the liberty of doing so with 4 of the videos (just add more to the video link array to finish it up, then drop the whole thing as the message for your command and edit the text to your liking
Here's a random video from the playlist $(eval const videos = ['ua-cam.com/video/ERyijCQllus/v-deo.html','ua-cam.com/video/MmGBDoDji3c/v-deo.html','ua-cam.com/video/im4ouCUr6yU/v-deo.html','ua-cam.com/video/MU-K7k_PvQU/v-deo.html']; videos[Math.floor(Math.random() * videos.length)];)