mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Clean up DiscordToMinecraftListener
This commit is contained in:
parent
0fc5b01b29
commit
1726050d65
@ -26,10 +26,26 @@ public class DiscordToMinecraftListener extends ListenerAdapter
|
|||||||
public void onMessageReceived(MessageReceivedEvent event)
|
public void onMessageReceived(MessageReceivedEvent event)
|
||||||
{
|
{
|
||||||
String chat_channel_id = ConfigEntry.DISCORD_CHAT_CHANNEL_ID.getString();
|
String chat_channel_id = ConfigEntry.DISCORD_CHAT_CHANNEL_ID.getString();
|
||||||
if (event.getMember() != null && !chat_channel_id.isEmpty() && event.getChannel().getId().equals(chat_channel_id))
|
if (event.getMember() == null)
|
||||||
{
|
{
|
||||||
if (!event.getAuthor().getId().equals(Discord.bot.getSelfUser().getId()))
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chat_channel_id.isEmpty())
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getAuthor().getId().equals(Discord.bot.getSelfUser().getId()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!event.getChannel().getId().equals(chat_channel_id))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Member member = event.getMember();
|
Member member = event.getMember();
|
||||||
String tag = getDisplay(member);
|
String tag = getDisplay(member);
|
||||||
Message msg = event.getMessage();
|
Message msg = event.getMessage();
|
||||||
@ -93,8 +109,7 @@ public class DiscordToMinecraftListener extends ListenerAdapter
|
|||||||
|
|
||||||
FLog.info(TextComponent.toLegacyText(components), true);
|
FLog.info(TextComponent.toLegacyText(components), true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDisplay(Member member)
|
public String getDisplay(Member member)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user