Skip to content

Commit

Permalink
autocrop commits
Browse files Browse the repository at this point in the history
  • Loading branch information
othello777 committed Nov 29, 2022
1 parent 740c938 commit 28c75db
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions src/MyEventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,19 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
import java.util.concurrent.CompletableFuture;

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.entities.Message.Attachment;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.internal.requests.Route.Emotes;
import uk.oczadly.karl.jnano.rpc.*;
import uk.oczadly.karl.jnano.rpc.util.RpcServiceProviders;
import uk.oczadly.karl.jnano.util.workgen.*;
Expand Down Expand Up @@ -170,7 +165,10 @@ public void onMessageReceived(MessageReceivedEvent event) {
"spamC(string) - spams contents in plain without spaces\r\n" +
"clearchat - clears the current chat ;)\r\n" +
"listargs - debug feature to test fricktm arg parser\r\n" +
"face (mention) - Sends user's profile picture\r\n" +
"face (mention) - Sends user's profile picture\r\n" +
"ratio (mention) - ratios them\r\n" +
"autocrop {video} - tries to automatically detect black bars and crop\r\n" +
"ambient - toggles on or off ambient interactions from Boby\r\n" +
"????? - I just wanna tell you how I'm feeling").queue();
else if (categ.contains("image") || categ.contains("img"))
channel.sendMessage("**Key: Command (required field) [optional field] {attachment} - what it does**\n"
Expand Down Expand Up @@ -693,6 +691,19 @@ else if(random.nextBoolean())
return;
}
if(command.startsWith("ratio")) {
List<Member> mentionsList = inputMessage.getMentions().getMembers();
if(mentionsList.size() > 1) {
channel.sendMessage("I can only ratio one person at a time").queue();
return;
}
else if (mentionsList.size() < 1) {
channel.sendMessage("please tell me who to ratio").queue();
return;
}
inputMessage.addReaction("U+267B").queue();
inputMessage.addReaction("U+2764").queue();
inputMessage.addReaction("U+1F4AC").queue();
channel.sendMessage(mentionsList.get(0).getAsMention() + " has been ratio’d!").queue();
}
if(command.startsWith("ambient")) {
List<String> exclude = ReadTextFile("exclude.txt");
Expand Down Expand Up @@ -1337,10 +1348,12 @@ else if(random.nextBoolean())
while((line=br.readLine())!=null) sb.append(line);
String crop = sb.toString();
System.out.println(crop);

int x = Integer.parseInt(crop.substring(0, crop.indexOf(':')));
int y = Integer.parseInt(crop.substring(crop.indexOf(':') + 1));

inputMessage.removeReaction("U+2699").queue();
if (x > 0 || y > 0){
if (x > 10 || y > 10){
inputMessage.addReaction("U+26A0").queue();
channel.sendMessage(
"\u26A0 Cringe Detected!\n "
Expand All @@ -1354,8 +1367,9 @@ else if(random.nextBoolean())
inputMessage.addReaction("U+2705").queue();
Thread.sleep(8*1000);
inputMessage.removeReaction("U+2705").queue();
DeleteFiles("autocrop");
}
DeleteFiles("autocrop");

}

super.onMessageReceived(event);
Expand Down

0 comments on commit 28c75db

Please sign in to comment.