How do I make a command that has a message and calls another command?


#1

For instance,
User: !command1
Nightbot: Hello There
nightbot calls !command2…
Nightbot: How are you doing?


#2

Without a custom API, you can’t make Nightbot send two separate messages in response to a single command. But you can make the second command print out what the first message passed to it.

Enter this into your chat:

!commands add !command1 -a=!command2 Hello There

!commands add !command2 $(query) How are you doing?

You can also add your commands here and use the Alias field.


#3

So if I were to do this in the Alias field, what would I enter in each command?


#4

For !command1, the Alias field should be !command2

For !command2, the Alias field should be empty


#5

But then Command1 would only call command2 right? It wouldn’t send the message?


#6

!command1 would call !command2 with the message Hello There

!command2 would send the message $(query) How are you doing?
$(query) is a Nightbot variable that is replaced by the message the command was called with.


#7

ok, i’ll try it. Thank you


#8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.