mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 12:47:36 +00:00
Don't send empty messages
This commit is contained in:
parent
f4007a7c9d
commit
3f68677d99
@ -20,7 +20,6 @@ import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.dv8tion.jda.api.AccountType;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.JDABuilder;
|
||||
@ -78,20 +77,20 @@ public class Discord extends FreedomService
|
||||
}
|
||||
try
|
||||
{
|
||||
bot = new JDABuilder(AccountType.BOT)
|
||||
.setToken(ConfigEntry.DISCORD_TOKEN.getString())
|
||||
.addEventListeners(new PrivateMessageListener())
|
||||
.addEventListeners(new DiscordToMinecraftListener())
|
||||
bot = JDABuilder.createDefault(ConfigEntry.DISCORD_TOKEN.getString())
|
||||
.addEventListeners(new PrivateMessageListener(),
|
||||
new DiscordToMinecraftListener(),
|
||||
new ListenerAdapter()
|
||||
{
|
||||
@Override
|
||||
public void onReady(ReadyEvent event)
|
||||
{
|
||||
new StartEvent(event.getJDA()).start();
|
||||
}
|
||||
})
|
||||
.setAutoReconnect(true)
|
||||
.setRateLimitPool(RATELIMIT_EXECUTOR)
|
||||
.addEventListeners(new ListenerAdapter()
|
||||
{
|
||||
@Override
|
||||
public void onReady(ReadyEvent event)
|
||||
{
|
||||
new StartEvent(event.getJDA()).start();
|
||||
}
|
||||
}).build();
|
||||
.build();
|
||||
FLog.info("Discord verification bot has successfully enabled!");
|
||||
}
|
||||
catch (LoginException e)
|
||||
|
@ -20,7 +20,7 @@ public class DiscordToMinecraftListener extends ListenerAdapter
|
||||
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.getAuthor().getId().equals(Discord.bot.getSelfUser().getId()))
|
||||
if (!event.getAuthor().getId().equals(Discord.bot.getSelfUser().getId()) && !event.getMessage().getContentDisplay().isEmpty())
|
||||
{
|
||||
Member member = event.getMember();
|
||||
String tag = getDisplay(member);
|
||||
|
Loading…
Reference in New Issue
Block a user