mirror of
https://github.com/bytedream/untisbot-discord.git
synced 2025-05-09 20:25:09 +02:00
Fixed bug that password with upper case letters do not work
This commit is contained in:
parent
656a0bf7c8
commit
bd11b2bf4e
@ -577,6 +577,7 @@ public class DiscordCommandListener extends ListenerAdapter {
|
|||||||
short klasseId;
|
short klasseId;
|
||||||
try {
|
try {
|
||||||
channel.sendMessage("Verifying data...").queue();
|
channel.sendMessage("Verifying data...").queue();
|
||||||
|
System.out.println(args[0] + args[1] + server + schoolName);
|
||||||
Session session = Session.login(args[0], args[1], server, schoolName);
|
Session session = Session.login(args[0], args[1], server, schoolName);
|
||||||
if (args.length == 3) {
|
if (args.length == 3) {
|
||||||
klasseId = (short) session.getInfos().getKlasseId();
|
klasseId = (short) session.getInfos().getKlasseId();
|
||||||
@ -593,6 +594,7 @@ public class DiscordCommandListener extends ListenerAdapter {
|
|||||||
}
|
}
|
||||||
allUntisSessions.putIfAbsent(guildId, session);
|
allUntisSessions.putIfAbsent(guildId, session);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
logger.warn("Error while trying to login", e);
|
||||||
channel.sendMessage("❌ The given login data is invalid").queue();
|
channel.sendMessage("❌ The given login data is invalid").queue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -962,10 +964,9 @@ public class DiscordCommandListener extends ListenerAdapter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String userInput = event.getMessage().getContentDisplay().substring(data.getPrefix().length()).trim().replaceAll(" +", " ");
|
String userInput = event.getMessage().getContentDisplay().substring(data.getPrefix().length()).trim().replaceAll(" +", " ");
|
||||||
String userInputLow = userInput.toLowerCase();
|
|
||||||
|
|
||||||
String[] splitCommand = userInputLow.split(" ");
|
String[] splitCommand = userInput.split(" ");
|
||||||
String command = splitCommand[0];
|
String command = splitCommand[0].toLowerCase();
|
||||||
String[] args = Arrays.copyOfRange(splitCommand, 1, splitCommand.length);
|
String[] args = Arrays.copyOfRange(splitCommand, 1, splitCommand.length);
|
||||||
try {
|
try {
|
||||||
runCommand(event.getGuild(), event.getChannel(), event.getMember().getPermissions().contains(Permission.ADMINISTRATOR), command, args);
|
runCommand(event.getGuild(), event.getChannel(), event.getMember().getPermissions().contains(Permission.ADMINISTRATOR), command, args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user