From df990e3bc97dd2d9da0e8d9452f95f3a59d5fb5a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 29 Jul 2021 18:23:47 +0200 Subject: [PATCH] Fix DiscordRulesMessage Fix DiscordSchemAlert Fix DiscordTicketMessage --- .../steamwar/bungeecore/bot/util/DiscordRulesMessage.java | 5 +++-- src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java | 6 ++++-- .../steamwar/bungeecore/bot/util/DiscordTicketMessage.java | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/de/steamwar/bungeecore/bot/util/DiscordRulesMessage.java b/src/de/steamwar/bungeecore/bot/util/DiscordRulesMessage.java index b2be0226..a1cb6fb6 100644 --- a/src/de/steamwar/bungeecore/bot/util/DiscordRulesMessage.java +++ b/src/de/steamwar/bungeecore/bot/util/DiscordRulesMessage.java @@ -21,10 +21,10 @@ package de.steamwar.bungeecore.bot.util; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig; +import lombok.experimental.UtilityClass; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; import net.dv8tion.jda.api.entities.Emoji; -import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.TextChannel; import net.dv8tion.jda.api.interactions.components.ActionRow; @@ -34,9 +34,10 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; +@UtilityClass public class DiscordRulesMessage { - public static void sendMessage() { + public void sendMessage() { TextChannel channel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(SteamwarDiscordBotConfig.RULES_CHANNEL); assert channel != null; Message message = null; diff --git a/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java b/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java index 58933a66..a01121bd 100644 --- a/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java +++ b/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.bot.util; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; import de.steamwar.bungeecore.sql.Schematic; import de.steamwar.bungeecore.sql.SteamwarUser; +import lombok.experimental.UtilityClass; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; import net.dv8tion.jda.api.entities.Emoji; @@ -32,9 +33,10 @@ import net.dv8tion.jda.api.interactions.components.Button; import java.awt.*; import java.time.Instant; +@UtilityClass public class DiscordSchemAlert { - public static void sendDecline(Schematic schematic, SteamwarUser user, String reason) { + public void sendDecline(Schematic schematic, SteamwarUser user, String reason) { if(user.getDiscordId() != null) { User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete(); EmbedBuilder builder = new EmbedBuilder(); @@ -54,7 +56,7 @@ public class DiscordSchemAlert { } } - public static void sendAccept(Schematic schematic, SteamwarUser user) { + public void sendAccept(Schematic schematic, SteamwarUser user) { if(user.getDiscordId() != null) { User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete(); EmbedBuilder builder = new EmbedBuilder(); diff --git a/src/de/steamwar/bungeecore/bot/util/DiscordTicketMessage.java b/src/de/steamwar/bungeecore/bot/util/DiscordTicketMessage.java index 207b9a7a..ab93000b 100644 --- a/src/de/steamwar/bungeecore/bot/util/DiscordTicketMessage.java +++ b/src/de/steamwar/bungeecore/bot/util/DiscordTicketMessage.java @@ -21,6 +21,7 @@ package de.steamwar.bungeecore.bot.util; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig; +import lombok.experimental.UtilityClass; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; import net.dv8tion.jda.api.entities.Message; @@ -32,9 +33,10 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; +@UtilityClass public class DiscordTicketMessage { - public static void sendMessage() { + public void sendMessage() { TextChannel channel = SteamwarDiscordBot.instance().getJda().getGuildById(SteamwarDiscordBotConfig.GUILD).getTextChannelById(SteamwarDiscordBotConfig.TICKET_CHANNEL); assert channel != null; Message message = null;