1 回答

TA貢獻1802條經(jīng)驗 獲得超10個贊
我認為你的問題是你沒有向你的函數(shù)傳遞任何參數(shù),你可以通過這樣做輕松修復(fù)它:
function lotteryCommand(arguments, receivedMessage){
/*note: receivedMessage is defined as the command (for my bot, it's e!spin)
and arguments is the part following the command (for this particular bit of code,
it's merits, so the user sends "e!spin merits")*/
if (arguments == "merits"){
// dont forget to pass in the required parameters while executing your function (parameter1, parameter2)
setTimeout(randomlottery1(arguments, receivedMessage), 1000);
}
else{receivedMessage.channel.send("Message here")}
}
添加回答
舉報