第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

你怎么能讓你的機器人發(fā)送第二個參數(shù)

你怎么能讓你的機器人發(fā)送第二個參數(shù)

開心每一天1111 2021-11-18 20:25:21
就像 !L JohnGameRage#0000 已經(jīng)把 L 給了 user#0000
查看完整描述

1 回答

?
慕工程0101907

TA貢獻1887條經(jīng)驗 獲得超5個贊

構(gòu)造參數(shù)的一種簡單方法是這樣的:


let full = message.content.substr(1).trim(); //remove the prefix

let split = full.split(/ +/g); //seperate the words in the String and put them into an array

let cmd = split[0]; //the command is the first word in the array

let args = split.slice(1); //the arguments are all words except for the first one

在您的示例L中將是命令并且JohnGameRage#0000將是第一個參數(shù)。


您可以像這樣從數(shù)組中讀取單個參數(shù):


//Command = !L firstArg secondArg thirdArg fourthArg etc

cmd //returns 'L'

args[0] //returns 'firstArg'

args[1] //returns 'secondArg '

args[2] //returns 'thirdArg '

args[3] //returns 'fourthArg '

args[4] //returns 'etc'


查看完整回答
反對 回復(fù) 2021-11-18
  • 1 回答
  • 0 關(guān)注
  • 170 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號