|
@ -102,6 +102,8 @@ client.on("message", async message => { |
|
|
ban(message); |
|
|
ban(message); |
|
|
} else if (message.content.toLowerCase().startsWith(`${prefix}kick`)) { |
|
|
} else if (message.content.toLowerCase().startsWith(`${prefix}kick`)) { |
|
|
kick(message); |
|
|
kick(message); |
|
|
|
|
|
} else if (message.content.toLowerCase().startsWith(`${prefix}addrole`)) { |
|
|
|
|
|
addRole(message); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -134,17 +136,18 @@ async function ban(message) { |
|
|
|
|
|
|
|
|
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}\`?`) |
|
|
.setDescription("React to your message to verify") |
|
|
.setDescription("React to this message to verify") |
|
|
.setThumbnail(member.user.avatarURL()) |
|
|
.setThumbnail(member.user.avatarURL()) |
|
|
.setColor("fda172") |
|
|
.setColor("fda172") |
|
|
.setTimestamp(); |
|
|
.setTimestamp(); |
|
|
message.channel.send(verificationEmbed).catch(console.error); |
|
|
message.channel.send(verificationEmbed).catch(console.error) |
|
|
message.react('👍'); |
|
|
.then(verificationEmbed => { |
|
|
message.react('👎'); |
|
|
verificationEmbed.react('👍'); |
|
|
|
|
|
verificationEmbed.react('👎'); |
|
|
const filter = (reaction, user) => { |
|
|
const filter = (reaction, user) => { |
|
|
return ['👍', '👎'].includes(reaction.emoji.name) && message.guild.members.cache.get(user.id).hasPermission('ADMINISTRATOR') && !user.bot; |
|
|
return ['👍', '👎'].includes(reaction.emoji.name) && message.guild.members.cache.get(user.id).hasPermission('ADMINISTRATOR') && !user.bot; |
|
|
}; |
|
|
}; |
|
|
message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] }) |
|
|
verificationEmbed.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] }) |
|
|
.then(userReaction => { |
|
|
.then(userReaction => { |
|
|
const reaction = userReaction.first(); |
|
|
const reaction = userReaction.first(); |
|
|
if (reaction.emoji.name === '👍') { |
|
|
if (reaction.emoji.name === '👍') { |
|
@ -153,6 +156,7 @@ async function ban(message) { |
|
|
message.reply(`phew! ${member}'s safe!`); |
|
|
message.reply(`phew! ${member}'s safe!`); |
|
|
} |
|
|
} |
|
|
}).catch(verificationEmbed => { verificationEmbed.edit("TIMEOUT") }); |
|
|
}).catch(verificationEmbed => { verificationEmbed.edit("TIMEOUT") }); |
|
|
|
|
|
}).catch(console.error); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function kick(message) { |
|
|
async function kick(message) { |
|
@ -184,7 +188,7 @@ async function kick(message) { |
|
|
|
|
|
|
|
|
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 your message to verify") |
|
|
.setDescription("React to this message to verify") |
|
|
.setThumbnail(member.user.avatarURL()) |
|
|
.setThumbnail(member.user.avatarURL()) |
|
|
.setColor("fda172") |
|
|
.setColor("fda172") |
|
|
.setTimestamp(); |
|
|
.setTimestamp(); |
|
|