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
  • Навчання та стиль

КОМЕНТАРІ • 68

  • @Phlare
    @Phlare  Рік тому +2

    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

    • @Airidd
      @Airidd 4 місяці тому +1

      i am just curious, can you copy paste the command?

    • @Phlare
      @Phlare  4 місяці тому

      @CocaineForKids it’s in the description if you need it, is that what you mean?

    • @Airidd
      @Airidd 4 місяці тому +1

      well can u uhm place the command into comments so i can copy paste it and edit it by myself

    • @Airidd
      @Airidd 4 місяці тому +1

      oh ok @@Phlare

    • @Phlare
      @Phlare  4 місяці тому

      ⁠ $(user) is $(eval Math.floor(Math.random()*100))% chaotic.

  • @HeroicJPRS
    @HeroicJPRS Рік тому +1

    amazing as always, my friend!

  • @user-eh2od6eu4s
    @user-eh2od6eu4s Рік тому +2

    underrated, great video!

  • @kitkates
    @kitkates 3 місяці тому +1

    thank youuu sm ! 🙂

  • @aveana
    @aveana 21 день тому +1

    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?

    • @Phlare
      @Phlare  21 день тому

      Yup, totally possible. What other adjectives would you like other than good and cool?

    • @Phlare
      @Phlare  21 день тому

      $(user) is a $(eval const adj = ['good','smart','spicy','cool']; adj[Math.floor(Math.random() * adj.length)];) bean.

    • @Phlare
      @Phlare  21 день тому

      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

    • @aveana
      @aveana 20 днів тому +1

      @@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.

    • @Phlare
      @Phlare  20 днів тому

      @aveana oh did you want a % in there somewhere too?

  • @user-dy2td4gj7q
    @user-dy2td4gj7q 11 місяців тому +1

    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?

    • @Phlare
      @Phlare  11 місяців тому

      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.

    • @user-dy2td4gj7q
      @user-dy2td4gj7q 11 місяців тому

      @@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?

  • @ChonBMarak
    @ChonBMarak 5 місяців тому +1

    ❤❤ welcome 👍

  • @enoakii
    @enoakii Рік тому +1

    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.

    • @Phlare
      @Phlare  Рік тому

      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.

    • @Phlare
      @Phlare  Рік тому +3

      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)];)

    • @enoakii
      @enoakii Рік тому +1

      @@Phlare wow thank you so much! you're a great help.

    • @parrymanilow
      @parrymanilow 8 місяців тому +1

      @@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)

    • @Phlare
      @Phlare  8 місяців тому

      @@parrymanilow nice one

  • @adamvaughan123
    @adamvaughan123 Місяць тому +1

    If you use a different percentage, such as 500, would it go up to 500 instead

  • @Caedan
    @Caedan 8 місяців тому +1

    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?

    • @Phlare
      @Phlare  8 місяців тому

      Like a user will use the command targeting someone else, and one of the two will be chosen randomly as part of the output?

    • @Phlare
      @Phlare  8 місяців тому

      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)];)

  • @finjacsr
    @finjacsr 2 місяці тому +1

    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

    • @finjacsr
      @finjacsr 2 місяці тому +1

      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%"

    • @Phlare
      @Phlare  2 місяці тому

      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

    • @finjacsr
      @finjacsr 2 місяці тому +1

      @@Phlare ty!

  • @merrykzietzke2792
    @merrykzietzke2792 8 місяців тому +1

    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!

    • @Phlare
      @Phlare  8 місяців тому

      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

    • @merrykzietzke2792
      @merrykzietzke2792 8 місяців тому +1

      @@Phlare thank you so much!!!

  • @randomgraficas
    @randomgraficas 29 днів тому +1

    How to add a voting system

    • @Phlare
      @Phlare  28 днів тому

      What kind of voting are you thinking of? Can’t you use the native polls in twitch for this?

  • @LadyMilkyMoo
    @LadyMilkyMoo 9 місяців тому +1

    is there one to change from percentage to cm?

    • @Phlare
      @Phlare  9 місяців тому +1

      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?

    • @LadyMilkyMoo
      @LadyMilkyMoo 9 місяців тому +1

      i guess 0-200cm @@Phlare

    • @Phlare
      @Phlare  9 місяців тому +1

      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

    • @LadyMilkyMoo
      @LadyMilkyMoo 9 місяців тому +1

      Thanks so much! You rock! @@Phlare

  • @RealRednax
    @RealRednax 15 днів тому +1

    I got a warning for saying !subcount lol

  • @Gokulcharm
    @Gokulcharm Місяць тому +2

    Math not defined coming😢

    • @Phlare
      @Phlare  Місяць тому

      must be a copy/paste issue. maybe you have an extra space or something?
      $(user) is $(eval Math.floor(Math.random()*100))% chaotic.

  • @LukeyPukeyPlays
    @LukeyPukeyPlays 7 місяців тому +1

    Mobile tutorials please

    • @Phlare
      @Phlare  7 місяців тому

      can you expand on what you mean by this?

  • @KippyKyteVT
    @KippyKyteVT Рік тому +1

    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)])

    • @Phlare
      @Phlare  Рік тому

      Hmm. I will have to play with it and see what I can see. Depends on what gets returned by the URL

    • @Phlare
      @Phlare  Рік тому

      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

    • @Phlare
      @Phlare  Рік тому

      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)];)