Answer the question
In order to leave comments, you need to log in
How to pass a parameter to a discord bot?
I decided to implement a simple game and ran into a problem
. I have 5 chat rooms and I need to send luggage to the 3rd room, for example, with the help of the command! Baggage 3 (well, or any other room)
Here is a super simple function that gives us luggage
function Baggage() {
var ArrayBaggage = ['Абонемент в спортзал','Фотоаппарат','Мультивитамины','Шикарное свадебное платье'];
var number=randomNumber(0, ArrayBaggage.length-1);
var Finnal="Специальная карта:"+ ArrayBaggage[number];
return Finnal;
}
client.on('message', msg => {
if (msg.content === '!Baggage3') {
msg.reply(Baggage()); //написать в канал 3 багаж
}
if (msg.content === '!Baggage1') {
msg.reply(Baggage()); //написать в канал 1 багаж
}
if (msg.content === '!Baggage2') {
msg.reply(Baggage()); //написать в канал 2 багаж
}});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question