Added automatic plugin updater and a few smaller changes #21
2 changed files with 24 additions and 1 deletions
|
@ -74,6 +74,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
|||
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<ReadyEvent> {
|
|||
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
|
||||
|
|
|
@ -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<MessageReceivedEvent> {
|
||||
@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());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue