-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmassban.py
39 lines (33 loc) · 897 Bytes
/
massban.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import requests
from colorama import Fore
import discord
from discord.ext import commands
import threading
TOKEN = input('Bot token: ')
print(f'For for banning write to chat: !massban')
headers = {
"Authorization":
f"Bot {TOKEN}"
}
client2 = commands.Bot(
command_prefix='!',
intents=discord.Intents.all(),
help_command=None
)
@client2.command()
async def massban(ctx):
await ctx.message.delete()
servr = ctx.guild.id
def mass_ban(i):
sessions = requests.Session()
sessions.put(
f"https://discord.com/api/v9/guilds/{servr}/bans/{i}",
headers=headers
)
for i in range(3):
for member in list(ctx.guild.members):
threading.Thread(
target=mass_ban,
args=(member.id,)
).start()
client2.run(TOKEN)