Archiviert
1
0

Merge branch 'master' into discord-bot

Dieser Commit ist enthalten in:
yoyosource 2021-07-29 16:45:55 +02:00
Commit a0482c8867
3 geänderte Dateien mit 13 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -31,6 +31,7 @@ import de.steamwar.bungeecore.listeners.mods.WorldDownloader;
import de.steamwar.bungeecore.sql.SQL; import de.steamwar.bungeecore.sql.SQL;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team; import de.steamwar.bungeecore.sql.Team;
import net.dv8tion.jda.api.JDA;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
@ -157,6 +158,12 @@ public class BungeeCore extends Plugin {
public void onDisable(){ public void onDisable(){
ErrorLogger.stop(); ErrorLogger.stop();
SQL.close(); SQL.close();
SteamwarDiscordBot.instance().getJda().shutdownNow();
try {
SteamwarDiscordBot.instance().getJda().awaitStatus(JDA.Status.SHUTDOWN);
} catch (Exception e) {
// Ignored
}
} }
public static BungeeCore get() { public static BungeeCore get() {

Datei anzeigen

@ -67,7 +67,11 @@ public class AuthManager {
member.getUser().openPrivateChannel().complete().sendMessage(builder.build()).complete(); member.getUser().openPrivateChannel().complete().sendMessage(builder.build()).complete();
if(member.getNickname() == null) { if(member.getNickname() == null) {
member.getGuild().modifyNickname(member, user.getUserName()).complete(); try {
member.getGuild().modifyNickname(member, user.getUserName()).complete();
} catch (Exception e) {
// Ignored
}
} }
TOKENS.remove(code); TOKENS.remove(code);
return member; return member;

Datei anzeigen

@ -60,7 +60,7 @@ public class DiscordRanks {
guild.removeRoleFromMember(member, role).complete(); guild.removeRoleFromMember(member, role).complete();
} }
if (!needed.isEmpty()) { if (needed != null && !needed.isEmpty()) {
guild.addRoleToMember(member, guild.getRoleById(needed)).complete(); guild.addRoleToMember(member, guild.getRoleById(needed)).complete();
} }
} }