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

Commit b23c040

Browse files
committed
2.1.0
- Added more information commands - Different Cooldowns per commands - Fix the kicking specific role with other roles
1 parent 648e497 commit b23c040

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2816
-192
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ node_modules/
110110

111111
data/
112112
json.sqlite
113-
package-lock.json
113+
114114

115115

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Mashwishi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
11
<div align="center">
2-
<a href="https://discord.com/api/oauth2/authorize?client_id=814580247973986314&permissions=259845516535&scope=bot"><img src="https://i.imgur.com/s4q1Wz3.png" width="15%"/></a>
3-
<h1><a href="https://discord.com/api/oauth2/authorize?client_id=814580247973986314&permissions=259845516535&scope=bot">Prune Bot </a></h1>
2+
<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>
3+
<h1><a href="https://discord.com/api/oauth2/authorize?client_id=814580247973986314&permissions=8&scope=bot%20applications.commands">Prune Bot </a></h1>
44

55
<h3>Version 2.0.0</h3>
66

77
<h4>Created by Mashwishi | Powered by <a href="https://discord.js.org/">Discord.js</a></h4>
8+
<h4>Do you need a free 24/7 Discord Hosting? <a href="https://discord.gg/j3Mx7cHgXF">Join now!</a></h4>
89

910
<h6>Fellow Developers that guide me doing this from Discord Server Community of <a href="https://discord.gg/discord-api">Discord API</a>.
1011
<br>Special Thanks to our contributors and helper <a href="https://github.com/esfox">esfox</a>, <a href="https://github.com/itsjusttriz">itsjusttriz</a> and <a href="https://github.com/Hickacou">Hickacou</a>!</h6>
1112

12-
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B14A4MU)
13-
14-
[![support][support-image]][support-invite]
13+
<!-- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B14A4MU) -->
14+
<!-- <a href="https://discordbotlist.com/bots/814580247973986314"><img src="https://discordbotlist.com/api/v1/bots/814580247973986314/widget"></a> -->
15+
<!-- [![support][support-image]][support-invite]-->
16+
17+
<p align="center">
18+
<table align="center">
19+
<tr>
20+
<td>
21+
<p align="center">
22+
<a href="https://ko-fi.com/mashwishi"> <img align="center" src="https://ko-fi.com/img/githubbutton_sm.svg" /></a>
23+
<br/><br/>
24+
<a href="https://discord.gg/WAh8eaF2Qq"><img align="center" src="https://discordapp.com/api/guilds/779997243159216149/widget.png?style=banner2" alt="Discord Banner 2"/> </a>
25+
</p>
26+
</td>
27+
<td>
28+
<p align="center">
29+
<br/>
30+
<a href="https://discordlist.space/bot/814580247973986314"><img src="https://api.discordlist.space/v2/bots/814580247973986314/widget?background=202225&radius=5"></a>
31+
</p>
32+
</td>
33+
</tr>
34+
</table>
35+
</p>
1536

1637
[![Contributors][contributors-shield]][contributors-url]
1738
[![Forks][forks-shield]][forks-url]
@@ -30,6 +51,10 @@
3051

3152
<strong><a href="https://discord.com/api/oauth2/authorize?client_id=816474139560378379&permissions=8&scope=bot">PruneBot (Development)</a></strong> is created for beta testing of the latest updates of PruneBot. This is also limited to 100 servers, This bot is not that stable and may contain bugs. There will be no support given to this version
3253

54+
<div align="center">
55+
<a href="https://discord.io/LIMYAW"><img src="https://i.imgur.com/N3UeQjC.jpg" width="100%"/></a>
56+
</div>
57+
3358
---
3459

3560
### Bot Features:
@@ -46,9 +71,6 @@
4671
- ⚠ | Embed links needed for bot embed messages
4772
- ⚠ | Admin Permission needed for Moderation commands
4873

49-
50-
---
51-
5274
<h2 align="center">Commands</h2>
5375

5476
### Featured Commands:
@@ -65,23 +87,31 @@ We have more than 80 commands in this bot, and they are **featured** and having
6587
- :stars: **Images:** `cat`, `changemymind`, `gay`, `trigger`, `circle`, and **7 more!**
6688
- :soccer: **Fun:** `8ball`, `reverse`, `snipe`, and **4 more!**
6789

68-
69-
## Issue/Suggestions
70-
71-
If met any issues, go [here](https://github.com/Mashwishi/PruneBot/issues) to report bug and create new issue for supporting
72-
73-
## Github Repository
74-
75-
PruneBot Made by Mashwishi, project [Here](https://github.com/Mashwishi/PruneBot)
90+
<h2 align="center">More PruneBot(s)</h2>
91+
<div align="center">
92+
<p>
93+
PruneBot Main is the only verified bot at the moment, If you're encountering issues with the main bot due to a lot of users feel free to use other versions of PruneBot there are 3 alternative PruneBot(s) the Blue, Green and Red this bot is currently not verified and can only handle up to 75+ Discord servers. If you can no longer use any of this alternative bots to your server due to limited invite please kindly contact me to our <a href="https://discod.io/LMYAW">Discord Server</a>.
94+
</p>
95+
<a href="https://discord.com/api/oauth2/authorize?client_id=814580247973986314&permissions=8&scope=bot%20applications.commands"><img alt="PruneBot Main" src="https://i.imgur.com/OEVbYKw.png" width="15%" ></a>
96+
<a href="https://discord.com/api/oauth2/authorize?client_id=869637540896989234&permissions=8&scope=bot%20applications.commands"><img alt="PruneBot Green" src="https://i.imgur.com/qWadO8f.png" width="15%" ></a>
97+
<a href="https://discord.com/api/oauth2/authorize?client_id=816474139560378379&permissions=8&scope=bot%20applications.commands"><img alt="PruneBot Red" src="https://i.imgur.com/ulh0MIU.png" width="15%" ></a>
98+
<a href="https://discord.com/api/oauth2/authorize?client_id=815785457672650802&permissions=8&scope=bot%20applications.commands"><img alt="PruneBot Blue" src="https://i.imgur.com/C4YuJBU.png" width="15%" ></a>
99+
</div>
76100

77101
<h2 align="center">Self-Hosting & Development</h2>
78102

103+
<div align="center">
104+
<p>Recommended Hosting (<i>This is affiliated link, Not officially endorsed or sponsored by Pebblehost</i>)</p>
105+
<a href="https://billing.pebblehost.com/aff.php?aff=1764"><img alt="PebbleHosting - Discord Bot Hosting" src="https://i.imgur.com/MLSVDuP.png"></a>
106+
</div>
107+
79108
**We ask you to please not host your own instance of PruneBot.** Even though our license allows it, self-hosted instances of the bot have brought us a lot of headache in the past. If you're considering self-hosting, please [try the official instance of the bot first](https://github.com/mashwishi/PruneBot/#). If you have any concerns about the security of our instance, please contact us. We'd love to talk and answer any questions you have.
80109

81110
> If you're really really really going to self-host the bot, please [read our license](https://github.com/mashwishi/PruneBot/blob/master/LICENSE) first, and be aware that we don't provide any self-hosting support. **You'll be on your own.**
82111
83-
## Getting Started
84112

113+
## Getting Started
114+
<h4>Do you need a free 24/7 Discord Hosting? <a href="https://discord.gg/j3Mx7cHgXF">Join now!</a></h4>
85115
This is how you will set-up your self-hosted Prune Bot.
86116

87117

@@ -118,8 +148,21 @@ This is how you will set-up your self-hosted Prune Bot.
118148
5. Start the bot from the project folder: `node shard.js`
119149
6. Open `http://localhost:8080/` or your project URL to view the http output.
120150

151+
## Issue/Suggestions
152+
153+
If met any issues, go [here](https://github.com/Mashwishi/PruneBot/issues) to report bug and create new issue for supporting
154+
155+
## Github Repository
156+
157+
PruneBot Made by Mashwishi, project [Here](https://github.com/Mashwishi/PruneBot)
158+
121159
---
122160

161+
<div align="center">
162+
<p>Recommended Hosting (<i>This is affiliated link, Not officially endorsed or sponsored by Pebblehost</i>)</p>
163+
<a href="https://billing.pebblehost.com/aff.php?aff=1764"><img alt="PebbleHosting - Discord Bot Hosting" src="https://pebblehost.com/src/img/branding/banner1.gif"></a>
164+
</div>
165+
123166
[support-invite]: https://discord.gg/WAh8eaF2Qq
124167
[support-image]: https://discordapp.com/api/guilds/779997243159216149/widget.png?style=banner2
125168

commands/custom/fetch.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports.run = async (client, message, args) => {
99
`${emojis.cross} ${message.author.username}, Missing Permission`
1010
)
1111
.setColor("RED");
12-
if (!message.member.hasPermission("ADMINISTRATOR")) {
12+
if (!message.member.hasPermission("ADMINISTRATOR") || message.author.id === 221838936866029568) {
1313
return message.channel.send(embed6).then(m => m.delete({ timeout: 5000 }));
1414
}
1515

@@ -77,5 +77,6 @@ module.exports.help = {
7777
description: "This command is used for fetching new data of the server.",
7878
usage: "p!fetch",
7979
accessableby: "Admins",
80-
aliases: []
80+
aliases: [],
81+
cooldown: 3600
8182
};

commands/custom/knorole.js

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ module.exports.run = async (client, message, args) => {
99
`${emojis.cross} ${message.author.username}, Missing Permission`
1010
)
1111
.setColor("RED");
12-
if (!message.member.hasPermission("ADMINISTRATOR")) {
12+
if (!message.member.hasPermission("KICK_MEMBERS") || message.author.id === 221838936866029568) {
1313
return message.channel.send(embed6).then(m => m.delete({ timeout: 5000 }));
1414
}
1515
//Bot no permission
1616
const notice3 = new Discord.MessageEmbed()
1717
.setDescription(`${emojis.cross} I don't have permission to list people!`)
1818
.setColor("RED");
19-
if (!message.guild.member(client.user).hasPermission("MANAGE_ROLES")) {
19+
if (!message.guild.member(client.user).hasPermission("KICK_MEMBERS")) {
2020
return message.channel.send(notice3).then(m => m.delete({ timeout: 5000 }));
2121
}
2222

@@ -61,6 +61,9 @@ module.exports.run = async (client, message, args) => {
6161
const newlistMsga = new Discord.MessageEmbed()
6262
.setTitle('Prune Bot | Total of '+ memberscount +' User(s)')
6363
.setDescription(`Users that has no role: \n` + getUsers(page))
64+
.addFields(
65+
{ name: 'Important Note:', value: "25 users can be only kicked per cooldown command."}
66+
)
6467
.setAuthor('Join our Discord Server', 'https://i.imgur.com/hKeHeEy.gif', 'https://discord.io/LIMYAW')
6568
.setThumbnail('https://i.imgur.com/ypxq7B9.png')
6669
.setColor('#b491c8')
@@ -73,6 +76,9 @@ module.exports.run = async (client, message, args) => {
7376
const newlistMsgb = new Discord.MessageEmbed()
7477
.setTitle('Prune Bot | Total of '+ memberscount +' User(s)')
7578
.setDescription(`Users that has no role: \n` + getUsers(page))
79+
.addFields(
80+
{ name: 'Important Note:', value: "25 users can be only kicked per cooldown command."}
81+
)
7682
.setAuthor('Join our Discord Server', 'https://i.imgur.com/hKeHeEy.gif', 'https://discord.io/LIMYAW')
7783
.setThumbnail('https://i.imgur.com/ypxq7B9.png')
7884
.setColor('#b491c8')
@@ -85,16 +91,34 @@ module.exports.run = async (client, message, args) => {
8591
.setDescription(`Users that has no role.`)
8692
.setAuthor('Join our Discord Server', 'https://i.imgur.com/hKeHeEy.gif', 'https://discord.io/LIMYAW')
8793
.setThumbnail('https://i.imgur.com/ypxq7B9.png')
88-
.setColor('#b491c8')
89-
.addFields(
90-
{ name: 'Operation Successful', value: memberscount + " user(s) has been kicked."}
91-
)
94+
.setColor('#b491c8')
9295
.setFooter(${nowyear} ${client.user.username} Created by Mashwishi.\nCommand requested by: ${message.author.username}#${message.author.discriminator}`, `https://i.imgur.com/ypxq7B9.png`)
93-
let members = message.guild.members.cache.filter(member => member.roles.cache.array().length < 2)
96+
97+
//2.0.0 (Current) - Kick users without role
98+
//let members = message.guild.members.cache.filter(member => member.roles.cache.array().length < 2)
99+
//members.forEach(m => {
100+
// m.kick()
101+
// .catch(console.error);
102+
//});
103+
104+
//2.1.0 - Limiting the kicking for 25 users per 5 minutes
105+
//Reason: Even discord.js already have feature to avoid rate-limited
106+
//I just want to make things sure to keep our bot running safe.
107+
let members = message.guild.members.cache.filter(member => member.roles.cache.array().length < 2)
108+
let count = 0
94109
members.forEach(m => {
95-
m.kick()
96-
.catch(console.error);
97-
});
110+
if(count == 25) return
111+
count++
112+
m.kick()
113+
.then(console.log)
114+
.catch(console.error);
115+
});
116+
117+
ukicked.addFields(
118+
//{ name: 'Operation Successful', value: memberscount + " user(s) has been kicked."}
119+
{ name: 'Operation Successful', value: count + " user(s) has been kicked."}
120+
)
121+
98122
listMsg.reactions.removeAll();
99123
listMsg.edit(ukicked);
100124
break;
@@ -148,5 +172,6 @@ module.exports.help = {
148172
description: "This command is used for listing and kicking all users with no role.",
149173
usage: "p!unorole",
150174
accessableby: "ADMINISTRATOR",
151-
aliases: []
175+
aliases: [],
176+
cooldown: 300
152177
};

0 commit comments

Comments
 (0)