mirror of
https://github.com/Noratrieb/killua-bot.git
synced 2026-01-14 15:15:01 +01:00
optimize imports
This commit is contained in:
parent
a730644a51
commit
e68d589075
8 changed files with 15 additions and 19 deletions
|
|
@ -6,7 +6,9 @@ import net.dv8tion.jda.api.EmbedBuilder;
|
|||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Random;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class FightCommand extends Command {
|
||||
|
||||
|
|
@ -30,14 +32,14 @@ public class FightCommand extends Command {
|
|||
|
||||
static class Fight {
|
||||
|
||||
private static String[] abilities = {"Little Flower", "Jajanken", "Lightning", "punch", "Chapter 7 Bankruptcy", "Ripper Cyclotron", "Rising Sun",
|
||||
private static final String[] abilities = {"Little Flower", "Jajanken", "Lightning", "punch", "Chapter 7 Bankruptcy", "Ripper Cyclotron", "Rising Sun",
|
||||
"100-Type Guanyin Bodhisattva"};
|
||||
|
||||
private Message fightMessage;
|
||||
private Fighter fighter1;
|
||||
private Fighter fighter2;
|
||||
private final Message fightMessage;
|
||||
private final Fighter fighter1;
|
||||
private final Fighter fighter2;
|
||||
|
||||
private Fighter currentFighter;
|
||||
private final Fighter currentFighter;
|
||||
Random random = new Random();
|
||||
|
||||
public Fight(Message fightMessage, String fighter1, String fighter2) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import net.dv8tion.jda.api.EmbedBuilder;
|
|||
import net.dv8tion.jda.api.entities.Member;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class HugCommand extends Command {
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.github.nilstrieb.commands.fun.trivia;
|
|||
import com.github.nilstrieb.cofig.Config;
|
||||
import com.github.nilstrieb.core.command.Command;
|
||||
import com.github.nilstrieb.core.sections.Section;
|
||||
import com.github.nilstrieb.util.ConsoleColors;
|
||||
import com.github.nilstrieb.util.trivia.TriviaQuestion;
|
||||
import com.github.nilstrieb.util.trivia.TriviaQuestionData;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
|
|
|
|||
|
|
@ -10,11 +10,12 @@ import net.dv8tion.jda.api.entities.Message;
|
|||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class EmoteAddCommand extends Command {
|
||||
|
||||
|
|
@ -116,7 +117,7 @@ public class EmoteAddCommand extends Command {
|
|||
private byte[] resizeImage(byte[] bytes, String format, int size) throws IOException {
|
||||
reply("Image size too big (" + bytes.length / 1000 + "kB). Resizing image...");
|
||||
Image image = ImageIO.read(new ByteArrayInputStream(bytes));
|
||||
double ratio = (double)image.getHeight(null) / (double)image.getWidth(null);
|
||||
double ratio = (double) image.getHeight(null) / (double) image.getWidth(null);
|
||||
image = image.getScaledInstance(size, (int) (size * ratio), Image.SCALE_SMOOTH);
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package com.github.nilstrieb.core.command;
|
||||
|
||||
import com.github.nilstrieb.cofig.Config;
|
||||
import com.github.nilstrieb.util.ConsoleColors;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The CommandHandler handles everything about the commands
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.github.nilstrieb.core.command;
|
||||
|
||||
import com.github.nilstrieb.util.ConsoleColors;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import com.github.nilstrieb.core.util.MultiPageEmbed;
|
|||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import net.dv8tion.jda.api.entities.MessageEmbed;
|
|||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* This class sends a message to the channel in the event that contains multiple pages that can be navigated using reactinos
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue