我想检查是否agrs[1]是会员名。
我目前使用的代码:
const Discord = require ('discord.js')
const client = new Discord.Client()
const PREFIX = "!";
client.on('ready', () => {
console.log('connect as ' + client.user.tag)
let guild = client.guilds.get('636639114787291137')
})
client.on('message', message =>{
let agrs = message.content.substring(PREFIX.length).split(" ");
switch (agrs[0]){
case 'teammate':
if (!agrs[1]) {
return message.reply("enter a member after !teammate")
}
else {
message.reply(agrs[1])
}
break;
}
})
client.login("xxx")
翻阅古今
holdtom
相关分类