diff --git a/src/main/java/buttondevteam/discordplugin/DiscordPlugin.java b/src/main/java/buttondevteam/discordplugin/DiscordPlugin.java index a8e078d..85f6869 100644 --- a/src/main/java/buttondevteam/discordplugin/DiscordPlugin.java +++ b/src/main/java/buttondevteam/discordplugin/DiscordPlugin.java @@ -74,6 +74,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener { public static IChannel chatchannel; public static IChannel issuechannel; public static IChannel botroomchannel; + public static IChannel officechannel; public static IGuild mainServer; public static IGuild devServer; @@ -94,7 +95,8 @@ public class DiscordPlugin extends JavaPlugin implements IListener { genchannel = mainServer.getChannelByID("125813020357165056"); // general chatchannel = mainServer.getChannelByID("249663564057411596"); // minecraft_chat issuechannel = devServer.getChannelByID("219643416496046081"); // server-issues - botroomchannel = devServer.getChannelByID("239519012529111040");// bot-room + botroomchannel = devServer.getChannelByID("239519012529111040"); // bot-room + officechannel = devServer.getChannelByID("219626707458457603"); // developers-office dc.changeStatus(Status.game("on TBMC")); } else { botchannel = devServer.getChannelByID("239519012529111040"); // bot-room diff --git a/src/main/java/buttondevteam/discordplugin/listeners/AutoUpdaterListener.java b/src/main/java/buttondevteam/discordplugin/listeners/AutoUpdaterListener.java new file mode 100644 index 0000000..1a5284b --- /dev/null +++ b/src/main/java/buttondevteam/discordplugin/listeners/AutoUpdaterListener.java @@ -0,0 +1,21 @@ +package buttondevteam.discordplugin.listeners; + +import buttondevteam.discordplugin.DiscordPlugin; +import sx.blah.discord.api.events.IListener; +import sx.blah.discord.handle.impl.events.MessageReceivedEvent; + +public class AutoUpdaterListener implements IListener { + @Override + public void handle(MessageReceivedEvent event) { + if (!event.getMessage().getChannel().equals(DiscordPlugin.officechannel)) + return; + if (event.getMessage().getWebhookID() == null) + return; + System.out.println(event.getMessage().getWebhookID()); + if (event.getMessage().getEmbedded().size() == 0) { + System.out.println("No embed"); + return; + } + System.out.println(event.getMessage().getEmbedded().get(0).getDescription()); + } +}