mirror of
https://github.com/bytedream/untisbot-discord.git
synced 2025-05-09 20:25:09 +02:00
Code cleanup
This commit is contained in:
parent
992accf51e
commit
cc7e1e4999
@ -12,7 +12,6 @@ import org.json.JSONTokener;
|
||||
import javax.security.auth.login.LoginException;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
@ -50,6 +49,7 @@ public class Discord {
|
||||
|
||||
/**
|
||||
* Show rich presence if a bot update was released within then last 24 hours
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
private void updateRichPresence() {
|
||||
|
@ -94,7 +94,6 @@ public class DiscordCommandListener extends ListenerAdapter {
|
||||
* @param permission if true, commands which needs (admin) permission to run, can be executed
|
||||
* @param command command to execute
|
||||
* @param args extra arguments for the command
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
private void runCommand(Guild guild, TextChannel channel, boolean permission, String command, String[] args) {
|
||||
@ -174,7 +173,8 @@ public class DiscordCommandListener extends ListenerAdapter {
|
||||
try {
|
||||
session.reconnect();
|
||||
className = session.getKlassen().findById(classId).getName();
|
||||
} catch (IOException ignore) {}
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
|
||||
String finalClassName = className; // yea java...
|
||||
LocalDate finalDate = date; // yea java part two...
|
||||
@ -195,7 +195,7 @@ public class DiscordCommandListener extends ListenerAdapter {
|
||||
}
|
||||
for (int i = 0; i < lessons.size(); i++) {
|
||||
ArrayList<Timetable.Lesson> listLessons = (ArrayList<Timetable.Lesson>) lessons.values().toArray()[i];
|
||||
for (Timetable.Lesson lesson: (ArrayList<Timetable.Lesson>) lessons.values().toArray()[i]) {
|
||||
for (Timetable.Lesson lesson : (ArrayList<Timetable.Lesson>) lessons.values().toArray()[i]) {
|
||||
String additional = "";
|
||||
if (lesson.getCode() == UntisUtils.LessonCode.CANCELLED) {
|
||||
additional = "~~";
|
||||
@ -293,8 +293,7 @@ public class DiscordCommandListener extends ListenerAdapter {
|
||||
if (!data.isCheckActive()) {
|
||||
embedBuilder.setFooter("The timetable checker is deactivated. Type `" + data.getPrefix() + "start` to re-enable it - use `" + data.getPrefix() + "help start` for more details");
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dataSet = "❌ Not set";
|
||||
embedBuilder.setFooter("To set your data, type `" + data.getPrefix() + "set-data <username> <password> <loginpage url>` - use `" + data.getPrefix() + "help data` for more details");
|
||||
}
|
||||
@ -777,7 +776,7 @@ public class DiscordCommandListener extends ListenerAdapter {
|
||||
String command = "";
|
||||
String[] args = null;
|
||||
|
||||
for (String cmd: commands) {
|
||||
for (String cmd : commands) {
|
||||
if (message.contains(cmd)) {
|
||||
if (event.isFromGuild()) {
|
||||
prefix = guildDataConnector.get(event.getGuild().getIdLong()).getPrefix();
|
||||
|
Loading…
x
Reference in New Issue
Block a user