Archiviert
1
0

fix(bot_upload): Use Punishment

Dieser Commit ist enthalten in:
Chaos 2022-03-06 17:49:21 +01:00
Ursprung 3b640f99d3
Commit 646b23af08

Datei anzeigen

@ -19,6 +19,7 @@
package de.steamwar.bungeecore.bot.listeners; package de.steamwar.bungeecore.bot.listeners;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SchematicNode; import de.steamwar.bungeecore.sql.SchematicNode;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.Message;
@ -36,6 +37,11 @@ public class PrivateMessageListener extends BasicDiscordListener {
return; return;
} }
if(user.isPunished(Punishment.PunishmentType.NoSchemReceiving)) {
event.getMessage().reply("Du darfst keine Schematics hochladen").complete();
return;
}
for (Message.Attachment attachment : event.getMessage().getAttachments()) { for (Message.Attachment attachment : event.getMessage().getAttachments()) {
if(attachment.getFileExtension() == null || if(attachment.getFileExtension() == null ||
(!attachment.getFileExtension().equalsIgnoreCase("schem") && (!attachment.getFileExtension().equalsIgnoreCase("schem") &&