【发布时间】:2021-03-13 03:49:08
【问题描述】:
服务器上有一个笑话,当我们使用命令+h 绑架,然后我们将昵称更改为用户(绑架者的属性),我将如何通过命令自动更改昵称?
var rand = [
'https://tenor.com/view/anime-kidnap-shh-reading-walking-gif-16716474',
'https://tenor.com/view/kidnap-crazy-anime-animation-cartoon-gif-5137884',
'https://media.tenor.com/images/5ae68746d329f3102d72d2ecc20ec1b0/tenor.gif',
'https://i.kym-cdn.com/photos/images/newsfeed/001/010/345/e2d.gif',
'https://media1.tenor.com/images/0cb215fd5530a8e3c127095c987e455f/tenor.gif?itemid=5869143',
'https://cdn.discordapp.com/attachments/576014006280519701/772153347742367784/1538820468_2e00f539e9a47173911f2af39ae5ecfe96f32ae4_hq.gif',
'https://cdn.discordapp.com/attachments/576014006280519701/772153350057623622/1512286824_1472546756_tumblr_ockwd0wF3R1qz64n4o1_540.gif'
];
return rand[Math.floor(Math.random() * rand.length)];
}
bot.on('message', message => {
let args = message.content.substring(PREFIX.length).split(" ");
switch (args[0]) {
case 'kidnap':
const personTagged = message.mentions.members.first();
if(!args[1]) {
message.channel.send('You are missing arguments!')
}else{
message.channel.send('`' + message.author.username + '`' + ' is kidnapping ' + personTagged.displayName + '! Quick! Run! ' + doKidnapAction())
}
break;
}
})
再次,我将如何更改昵称?
【问题讨论】:
-
这能回答你的问题吗? Change user nickname with discord.js
标签: discord.js bots