[FEAT] Change DiscordMessageEvent to pass Member, to allow things like Role Color for the chat

This commit is contained in:
2023-07-02 01:32:01 +02:00
parent 93bd24cc22
commit 62ca3ec812
2 changed files with 3 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ public class DiscordMessageHooks {
if (SDLinkConfig.INSTANCE.generalConfig.debugging) { if (SDLinkConfig.INSTANCE.generalConfig.debugging) {
BotController.INSTANCE.getLogger().info("Sending Message from {}: {}", event.getAuthor().getName(), event.getMessage().getContentStripped()); BotController.INSTANCE.getLogger().info("Sending Message from {}: {}", event.getAuthor().getName(), event.getMessage().getContentStripped());
} }
SDLinkPlatform.minecraftHelper.discordMessageReceived(event.getMember().getEffectiveName(), event.getMessage().getContentRaw()); SDLinkPlatform.minecraftHelper.discordMessageReceived(event.getMember(), event.getMessage().getContentRaw());
} catch (Exception e) { } catch (Exception e) {
if (SDLinkConfig.INSTANCE.generalConfig.debugging) { if (SDLinkConfig.INSTANCE.generalConfig.debugging) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -6,6 +6,7 @@ package com.hypherionmc.sdlink.core.services.helpers;
import com.hypherionmc.sdlink.core.accounts.MinecraftAccount; import com.hypherionmc.sdlink.core.accounts.MinecraftAccount;
import com.hypherionmc.sdlink.core.messaging.Result; import com.hypherionmc.sdlink.core.messaging.Result;
import net.dv8tion.jda.api.entities.Member;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import java.util.List; import java.util.List;
@@ -16,7 +17,7 @@ import java.util.List;
*/ */
public interface IMinecraftHelper { public interface IMinecraftHelper {
void discordMessageReceived(String username, String message); void discordMessageReceived(Member member, String message);
Result checkWhitelisting(); Result checkWhitelisting();
Result isPlayerWhitelisted(MinecraftAccount account); Result isPlayerWhitelisted(MinecraftAccount account);
Result whitelistPlayer(MinecraftAccount account); Result whitelistPlayer(MinecraftAccount account);