Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on('message', message => {
- if (message.author.bot) return;
- let args = message.content.split(" ");
- const mention = message.mentions.members.first() || message.author
- let command = args[0];
- let user = message.mentions.users.first();
- let bantime = args[2];
- let reasonban = message.content.split(" ").slice(3).join(" ");
- let timefilter;
- if (command == prefix + "ban") {
- if(!message.channel.guild){
- message.channel.send("**You Cant this command in private**");
- }
- if(!message.member.hasPermission("BAN_MEMBERS")) {
- message.channel.send("**You Need to have Permmison `BAN_MEMBERS`**");
- }
- if(!message.guild.member(client.user).hasPermission("BAN_MEMBERS")) {
- message.channel.send("**Bot dosent have permission `BAN_MEMBERS`**");
- }
- if (!user){
- message.channel.send("**Mention Member !!**");
- }else if (!bantime){
- message.channel.send(`**
- choose time
- 15m
- 30m
- 1h
- 3h
- 1d
- 3d
- 1w
- 1mon
- **`);
- }else if (!reasonban){
- message.channel.send("**You need to put ban reason**");
- }
- if (!message.mention.hasPermission("BAN_MEMBERS")){
- message.channel.send("**cant ban this member he is from staff**");
- } else {
- if (bantime = "15m") {
- timefilter = 150000;
- } else if (bantime = "30m") {
- timefilter = 300000;
- } else if (bantime = "1h") {
- timefilter = 600000;
- } else if (bantime = "3h") {
- timefilter = 1800000;
- } else if (bantime = "1d") {
- timefilter = 14400000;
- } else if (bantime = "3d") {
- timefilter = 43200000;
- } else if (bantime = "1w") {
- timefilter = 100800000;
- } else if (bantime = "1mon"){
- timefilter = 432000000;
- }
- message.guild.member(user).ban()
- message.channel.send("**The Member Was Banned **" + user.tag + " **By** : " + message.author.tag);
- message.channel.send("**Reason : __" + reasonban + "__**");
- user.send("**You are Banned By** : " + message.author.tag);
- user.send("**Reason : __" + reasonban + "__**");
- setTimeout(() => {
- message.guild.unban(bannedman);
- }, timefilter);
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement