Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit 76a4e3f

Browse files
MashwishiMashwishi
authored andcommitted
2.2.0
1 parent e9d5b85 commit 76a4e3f

26 files changed

+351
-2326
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
TOKEN= {Your Discord Token}
2+
TOPGG= {Your TOPGG Token}
3+
DLS= {Your DLS Token}
4+
OWNERID=221838936866029568

.env-sample

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
TOKEN=PutYourTokenHere
2-
OWNERID=221838936866029568
3-
1+
TOKEN= {Your Discord Token}
2+
TOPGG= {Your TOPGG Token}
3+
DLS= {Your DLS Token}
4+
OWNERID=221838936866029568

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ npm-debug.log*
66
yarn-debug.log*
77
yarn-error.log*
88
lerna-debug.log*
9+
.vscode
910

1011
# Diagnostic reports (https://nodejs.org/api/report.html)
1112
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@@ -70,7 +71,7 @@ typings/
7071
.yarn-integrity
7172

7273
# dotenv environment variables file
73-
.env
74+
#.env
7475
.env.test
7576

7677
# parcel-bundler cache (https://parceljs.org/)
@@ -110,6 +111,6 @@ node_modules/
110111

111112
data/
112113
json.sqlite
113-
114+
package-lock.json
114115

115116

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
worker: node shard.js
1+
worker: npm start

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a href="https://discord.com/api/oauth2/authorize?client_id=814580247973986314&permissions=8&scope=bot%20applications.commands"><img src="https://i.imgur.com/s4q1Wz3.png" width="15%"/></a>
33
<h1><a href="https://discord.com/api/oauth2/authorize?client_id=814580247973986314&permissions=8&scope=bot%20applications.commands">Prune Bot </a></h1>
44

5-
<h3>Version 2.1.0</h3>
5+
<h3>Version 2.2.0</h3>
66

77
<h4>Created by Mashwishi | Powered by <a href="https://discord.js.org/">Discord.js</a></h4>
88

commands/custom/fetch.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const Discord = require("discord.js");
22
const config = require("../../config/config.json");
33

4-
module.exports.run = async (client, message, args) => {
4+
module.exports.run = async (client, message, args) => {
55

66
//User no permission
77
const embed6 = new Discord.MessageEmbed()
@@ -19,7 +19,7 @@ module.exports.run = async (client, message, args) => {
1919
.setColor("RED");
2020
if (!message.guild.member(client.user).hasPermission("ADMINISTRATOR")) {
2121
return message.channel.send(notice3).then(m => m.delete({ timeout: 5000 }));
22-
}
22+
}
2323

2424
//Process
2525
const ListEmbedP = new Discord.MessageEmbed()
@@ -61,16 +61,15 @@ module.exports.run = async (client, message, args) => {
6161
//Fetching data (new)
6262
try
6363
{
64-
await message.guild.members.fetch()
65-
.then(console.log)
64+
await message.guild.members.fetch();
65+
//.then(console.log)
6666
}
6767
catch (error)
6868
{
6969
console.error(error);
7070
return listMsg.edit(ListEmbedF);
7171
}
72-
return listMsg.edit(ListEmbedS);
73-
72+
return listMsg.edit(ListEmbedS);
7473
};
7574
module.exports.help = {
7675
name: "fetch",

commands/custom/knorole.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const Discord = require("discord.js");
22
const config = require("../../config/config.json");
33

4-
module.exports.run = async (client, message, args) => {
4+
module.exports.run = async (client, message, args) => {
55

66
//User no permission
77
const embed6 = new Discord.MessageEmbed()

commands/custom/krole.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const Discord = require("discord.js");
22
const config = require("../../config/config.json");
33

44
module.exports.run = async (client, message, args) => {
5-
65
//User no permission
76
const embed6 = new Discord.MessageEmbed()
87
.setDescription(

commands/custom/prune.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const Discord = require("discord.js");
2+
const config = require("../../config/config.json");
3+
4+
module.exports.run = async (client, message, args) => {
5+
6+
//User no permission
7+
const embed6 = new Discord.MessageEmbed()
8+
.setDescription(
9+
`${emojis.cross} ${message.author.username}, Missing Permission`
10+
)
11+
.setColor("RED");
12+
if (!message.member.hasPermission("KICK_MEMBERS") || message.author.id === 221838936866029568) {
13+
return message.channel.send(embed6).then(m => m.delete({ timeout: 5000 }));
14+
}
15+
16+
//Bot no permission
17+
const notice3 = new Discord.MessageEmbed()
18+
.setDescription(`${emojis.cross} I don't have permission to list people!`)
19+
.setColor("RED");
20+
if (!message.guild.member(client.user).hasPermission("KICK_MEMBERS")) {
21+
return message.channel.send(notice3).then(m => m.delete({ timeout: 5000 }));
22+
}
23+
24+
//List and Pruning
25+
let mentionedrole = message.mentions.roles.firstKey()
26+
const withoutPrefix = message.content.slice(config.prefix.length);
27+
const split = withoutPrefix.split(/ +/);
28+
const command = split[0];
29+
const argss = split.slice(1);
30+
let id = argss[0];
31+
32+
//Didn't mention a role
33+
const notice2 = new Discord.MessageEmbed()
34+
.setDescription(`${message.author}, You didn't mention a role!`)
35+
.setColor("RED");
36+
if (!args.length) return message.channel.send(notice2);
37+
38+
//Didn't mention the exact role
39+
const embed7 = new Discord.MessageEmbed()
40+
.setTitle("Wrong Usage!")
41+
.setDescription("Correct Example: p!prune <role> <days>")
42+
.setColor("RED");
43+
if (!id.startsWith('<@&') && id.endsWith('>')) {
44+
message.delete();
45+
return message.channel.send(embed7).then(m => m.delete({ timeout: 5000 }));
46+
}
47+
48+
49+
50+
51+
};
52+
module.exports.help = {
53+
name: "prune",
54+
description: "Pruning users in specific roles and days.",
55+
usage: "p!prune <role> <days>",
56+
accessableby: "ADMINISTRATOR",
57+
aliases: [],
58+
cooldown: 300
59+
};

commands/custom/setprefix.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const fs = require("fs");
33
const settings = require("../../config/settings.json");
44

55
module.exports.run = async (client, message, args) => {
6+
67
const embedmissingperms = new Discord.MessageEmbed()
78
.setDescription(
89
`${emojis.cross} ${message.author.username}, Missing Permission!`
@@ -15,7 +16,7 @@ module.exports.run = async (client, message, args) => {
1516

1617
const embedtoolong = new Discord.MessageEmbed()
1718
.setDescription(
18-
`${emojis.cross} Prefix's length shouldn't be longer than 3 letters`
19+
`${emojis.cross} Prefix's length shouldn't be longer than 5 letters`
1920
)
2021
.setColor("RED");
2122
const embedsame = new Discord.MessageEmbed()
@@ -29,7 +30,7 @@ module.exports.run = async (client, message, args) => {
2930

3031
if (!args[0]) return message.channel.send(embedmissing);
3132

32-
if (args[0].length > 3) return message.channel.send(embedtoolong);
33+
if (args[0].length > 5) return message.channel.send(embedtoolong);
3334
if (args[0] == client.settings.get(message.guild.id, "prefix"))
3435
return message.channel.send(embedsame);
3536

0 commit comments

Comments
 (0)