Browse Source

Return if member tries to ban/kick themself

master
Abheek Dhawan 4 years ago
parent
commit
defab62460
  1. 11
      bot.js

11
bot.js

@ -444,6 +444,11 @@ async function ban(message) {
const member = members.array()[0]; const member = members.array()[0];
if (member === message.member) {
message.reply("you can't ban yourself!");
return;
}
let verificationEmbed = new Discord.MessageEmbed() let verificationEmbed = new Discord.MessageEmbed()
.setTitle(`Are you sure you would like to ban \`${member.user.tag}\`?`) .setTitle(`Are you sure you would like to ban \`${member.user.tag}\`?`)
.setAuthor(member.user.tag, member.user.avatarURL()) .setAuthor(member.user.tag, member.user.avatarURL())
@ -501,6 +506,12 @@ async function kick(message) {
const member = members.array()[0]; const member = members.array()[0];
if (member === message.member) {
message.reply("you can't ban yourself!");
return;
}
const verificationEmbed = new Discord.MessageEmbed() const verificationEmbed = new Discord.MessageEmbed()
.setTitle(`Are you sure you would like to kick \`${member.user.tag}\`?`) .setTitle(`Are you sure you would like to kick \`${member.user.tag}\`?`)
.setDescription("React to this message to verify") .setDescription("React to this message to verify")

Loading…
Cancel
Save