Hi guys, I have a question
Can I make the bot react differently to the command? So to speak, different answers to 1 command
I hope I could explain what I need
the bot will answer “no” or answer “yes” or answer “maybe”
Depending on the answer options
If this can be done, please tell us in detail how?
@NikaMyaso Welcome to the community. Try this:
!addcom -cd=5 !COMMAND_NAME $(eval const responses = [`yes`, `no`, `maybe`]; responses[Math.floor(Math.random() * responses.length)];)
Your command is similar to
And if I want to add some long answers, can I do it somehow?
Can I somehow add many long text answer choices? For example, quotes from famous people
Yes you can. Just note that there is a character limit. There is a way around it if you need a lot of responses though.
yes, I would like to get around this limitation
But how can this be done?
You’ll want to use pastebin you’ll write out a pastebin like this:
Make sure the ‘:’ is in between all the responses
Can you describe this in more detail? And throw off an example
@NikaMyaso Well, you can use mine quotes command.
!addcom -cd=5 !quotes $(eval a = $(urlfetch json https://pastebin.com/raw/CQ6sdh4r); a[Math.floor(Math.random() * a.length)];)
So basically you’ll want to creat an account on pastebin and write out the responses like I said. Here’s an example https://pastebin.com/raw/6AfagFQq
Then the command will look like this:
$(eval a=`$(urfletch json Raw_Pastebin_Link)`.split(`SEPARATOR`);a[Math.floor(Math.random()*a.length)])
The “SEPARATOR” is whatever you use to separate the responses it should be something like , ; : | ~ or - just things that wont appear in the qoutes. The raw pastebin link is the link to your pastebin file.
The answers should look like in the link from this user?(https://pastebin.com/raw/CQ6sdh4r)
Or just start on a new line like in your example?
(sorry for a bunch of questions, I’m new here)
I’d recommend just putting the answers in the way I showed as it is simpler to do. But both work just the way you format the command is different depending on which you use.
Should I replace the word “SEPARATOR” with the ending character or leave it as it is?
.split(`SEPARATOR`); or .split(`|`);
Thank you, it was your method that worked for me
@NikaMyaso I will add more quotes in the future. Regards
Para que sirve este comando
how to make the bot respond normally to a person?
That should work…
Is the command just this text or is it an
$(eval) or something else?
Do you mind posting the command text, not a screenshot? That would help us help you.
I used this command with several answer options, but for some reason the bot did not mention the person who called it
$(eval a = $(urlfetch json https://pastebin.com/raw/7FGZVsy3); a[Math.floor(Math.random() * a.length)];)