Need Help RokettoJanpu

I have this custom command -:

!luck

$(user) has $(eval a=Math.ceil(Math.random()*100);a>1?${a} % luck:1 luck).

is this correct?

Plus, I want to add an emoji at the end of nightbot reply with the following condition -:

  1. If luck% > 50 :smile:
  2. If luck% < 50 :slightly_frowning_face:
  3. If luck% = 50 :+1:

Please create a command.
Thanks

EDIT::
I also want to make a command which will work in the following way -:
If in youtube live chat someone uses @name in his sentence(if nighbot can track the word in the whole sentence then its cool, otherwise let him check whether the first word of the message is @name and then reply), then nightbot will reply -:

$(user), Don’t disturb name. He is watching tv, bathing/sleeping/eating.

-> THis part will be common in all messages ($(user), Don’t disturb name. He is) and then a random word ( watching tv bathing sleeping eating). I want to add as many random words I can add.

1 Like

@hizusaw

!addcom -cd=5 !luck $(user) has $(eval a=Math.ceil(Math.random()*100);if(a>50){b=`😄`;}else if(a<50){b=`🙁`;}else{b=`👍`;}`${a}% luck. ${b}`)
1 Like

For your second command. Replace name with the specific username you want to trigger the command:

!addcom -cd=5 @name $(user), don't disturb name. He is $(eval a=[`watching TV`,`bathing`,`sleeping`,`eating`,`ADD MORE WORDS HERE`];a[Math.floor(Math.random()*a.length)]).
1 Like

Also,
Is there a way to make night bot spam messages?
Like i want my insta id to be spammed in chat nightbot!

And you helped me create around 10 fantastic commands.
Can I put your name(and link of your profile) in my stream description as the creator of commands?

You can use this to make Nightbot send multiple messages in one command, up to 6 messages per command use. Note that Nightbot can only send messages as fast as 1 message per 5 seconds:

$(urlfetch https://vxrl.xyz/smm/message 1/message 2/message 3/message 4/message 5/message 6)

Go ahead, I have no problem with you adding my name to your Steam profile description. :+1:

1 Like

Hey @RokettoJanpu
I used the last command you shared.
Its showing this error message-: Remote Server Returned Code 404

EDIT:
Also, I want to try something which I see very often in live chats. And that is Nightbot song commands.
What is it? Can Nightbot tell the song which is playing? Can Nightbot add the song in list to be played? DO Nightbot do these stuffs automatically or I have to manually change the songs name in command output?Does Nightbot plays the song or I have to manually do it? Can you teach me how to use these song commands?

I forgot my mail id and password :frowning:
This is my new id.
I want to make a command which works in the following ways:

user : !ban @RokettoJanpu
Nightbot: Opps! user blocked RokettoJanpu.

Please notice that when user is using !ban command, he is using @ then name to specify the person name whom he wants to ban. But nightbot should ignore @ while replying.

Please help.

EDIT::

Hey, I just created a server on discord, and made nightbot joined it. Is there any extra features for discord ? Also, can’t we separate commands for youtube and discord? What is I don’t want some commands to be worked on discord. If its not possible then only way is to make a new nightbot account? I am new in this topic so please explain me about this.

@yanef

The command I sent for spamming messages doesn’t seem to work well with links, sorry. My guess is the slashes in the links are messing up the command, so there’s not much I can do about that.


The Nightbot AutoDJ lets you listen to songs while streaming, and you can allow viewers to request songs to be played. If you set up your streaming software correctly, you can broadcast these song requests to your livestream. I suggest reading about how to set this up in the Nightbot docs: https://docs.nightbot.tv/control-panel/autodj


This is your !ban command. Nightbot will not respond if there is no username input after the command:

!addcom -cd=5 !ban $(eval a=decodeURIComponent(`$(querystring)`).replace(/@/g,``);a?`Oops! $(user) banned ${a}.`:` `)

Nightbot on Discord is very similar to Nightbot on YouTube; it can respond to commands and has chat spam filters. However, Nightbot on Discord also has role syncing capabilities; this means you can set up Nightbot to give your YouTube moderators or regulars certain roles on your Discord server. Read the docs about all this at https://docs.nightbot.tv/discord

1 Like

Okay!
This command is working fine, however i need a small change in it.
If the user banned himself, then I want nightbot to message Oops! $(user) banned himself.

Ex-:
drake: !ban @drake
Nightbot: Oops! drake banned himself.

!addcom -cd=5 !ban $(eval a=decodeURIComponent(`$(querystring)`).replace(/@/g,``);u=`$(user)`;if(a){if(a.toLowerCase()!=u.toLowerCase()){`Oops! ${u} banned ${a}.`;}else{`Oops! ${u} banned himself.`;}}else{` `;})
1 Like

One more help.

I found this command -:
$(eval Math.ceil(Math.random()*100)>1?COMMON_RESPONSE:RARE_RESPONSE)

here chances of common response is 99% and rare response is 1%.
Where should I make changes in the code to change the response %? (I guess its 1 :thinking:)

Yes, just change that 1 to whatever other number you want. For example, if you change it to 13, then Nightbot has a 87% chance of outputting the common response and a 13% chance of outputting the rare response.

1 Like

hey dude! You made this command -:

!addcom -cd=5 !hug $(user) hugs $(eval a=decodeURIComponent(`$(querystring)`);a==``?`$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))`:a)!

will this work on youtube?

Sorry, that command only works for Twitch, not YouTube. Specifically, the API that fetches a random viewer doesn’t work for YouTube channels.

1 Like

Is this correct !hug command? I edited the !ban command you gave me.

!addcom -cd=5 !hug $(eval a=decodeURIComponent(`$(querystring)`).replace(/@/g,``);u=`$(user)`;if(a){if(a.toLowerCase()!=u.toLowerCase()){`wow! ${u} hugged${a}.`;}else{`wow! ${u} hugged himself.`;}}else{` `;})

Also is it possible that if a user doesn’t specify any user to ban or hug then nightbot will say he banned/hugged himself?
Like:
user : !ban
nb: user banned himself.
user : !ban @user
nb : user banned himself.

Your edited !hug command looks fine. You just need to put in a space towards the end of the code at this part:

`wow! ${u} hugged ${a}.`;

This will make Nightbot output “Wow! $(user) hugged himself.” if the user specifies themself or doesn’t specify anyone:

!addcom -cd=5 !hug $(eval a=decodeURIComponent(`$(querystring)`).replace(/@/g,``);u=`$(user)`;!a||a.toLowerCase()==u.toLowerCase()?`Wow! ${u} hugged himself.`:`Wow! ${u} hugged ${a}.`)
1 Like

one more edit in the last code please :sweat_smile:
if someone hugged nightbot then can nightbot ans -: @user Thanks for hugging me!
this is last edit, i promise :neutral_face:

The new command response is over 200 characters, the limit for YouTube commands, so I uploaded part of the script to Pastebin and set up the command to fetch from there.

!addcom -cd=5 !hug $(eval a=decodeURIComponent(`$(querystring)`).replace(/@/g,``);u=`$(user)`;$(urlfetch json https://pastebin.com/raw/miyLV9g8))
1 Like

Hey @RokettoJanpu

This is the !luck command you made -:

!addcom -cd=5 !luck $(user) has $(eval a=Math.ceil(Math.random()*100);if(a>50){b=`😄`;}else if(a<50){b=`🙁`;}else{b=`👍`;}`${a}% luck. ${b}`)

Can you edit this also, please?
I want that one user can only use this command once per day ( make a reset command also so that I can reset it every day).
If the person uses !luck command more than once then he will get the same response as before. (it this is possible then it’s good otherwise nb will answer a custom message. Remember, once you made a !boy !girl and !bgreset command, just like that)

Hey dude!
There is a small issue in code -:
When user hugs himself then nightbot is saying Wow! user hugged user instead of saying user hugged himself.

Let me again explain what I want in !hug command.
If a user uses !hug without specifying someone then nb answers Wow! user hugged everyone!
if a user uses !hug @user (his own name) then nb answers Wow! user hugged himself!
If a user uses !hug @Nightbot then nb answers user Thanks for hugging me!
and if a user uses !hug @RokettoJanpu then nb answers Wow! user hugged RokettoJanpu!