From 646b23af084730547f635c8fb7c105b416bc4027 Mon Sep 17 00:00:00 2001 From: Chaos Date: Sun, 6 Mar 2022 17:49:21 +0100 Subject: [PATCH] fix(bot_upload): Use Punishment --- .../bungeecore/bot/listeners/PrivateMessageListener.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/de/steamwar/bungeecore/bot/listeners/PrivateMessageListener.java b/src/de/steamwar/bungeecore/bot/listeners/PrivateMessageListener.java index e543292b..f90b9d11 100644 --- a/src/de/steamwar/bungeecore/bot/listeners/PrivateMessageListener.java +++ b/src/de/steamwar/bungeecore/bot/listeners/PrivateMessageListener.java @@ -19,6 +19,7 @@ package de.steamwar.bungeecore.bot.listeners; import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SchematicNode; import de.steamwar.bungeecore.sql.SteamwarUser; import net.dv8tion.jda.api.entities.Message; @@ -36,6 +37,11 @@ public class PrivateMessageListener extends BasicDiscordListener { return; } + if(user.isPunished(Punishment.PunishmentType.NoSchemReceiving)) { + event.getMessage().reply("Du darfst keine Schematics hochladen").complete(); + return; + } + for (Message.Attachment attachment : event.getMessage().getAttachments()) { if(attachment.getFileExtension() == null || (!attachment.getFileExtension().equalsIgnoreCase("schem") &&