Added check for Maven project
This commit is contained in:
parent
329c2eeaa2
commit
b7c8e9dfa6
1 changed files with 3 additions and 1 deletions
|
@ -5,6 +5,7 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
import buttondevteam.discordplugin.DiscordPlugin;
|
import buttondevteam.discordplugin.DiscordPlugin;
|
||||||
import buttondevteam.discordplugin.DiscordSender;
|
import buttondevteam.discordplugin.DiscordSender;
|
||||||
|
import buttondevteam.lib.PluginUpdater;
|
||||||
import buttondevteam.lib.TBMCCoreAPI;
|
import buttondevteam.lib.TBMCCoreAPI;
|
||||||
import sx.blah.discord.api.events.IListener;
|
import sx.blah.discord.api.events.IListener;
|
||||||
import sx.blah.discord.handle.impl.events.guild.channel.message.MessageReceivedEvent;
|
import sx.blah.discord.handle.impl.events.guild.channel.message.MessageReceivedEvent;
|
||||||
|
@ -29,13 +30,14 @@ public class AutoUpdaterListener implements IListener<MessageReceivedEvent> {
|
||||||
String branch = title.substring(title.indexOf(':') + 1, title.indexOf(']'));
|
String branch = title.substring(title.indexOf(':') + 1, title.indexOf(']'));
|
||||||
String project = title.substring(title.indexOf('[') + 1, title.indexOf(':'));
|
String project = title.substring(title.indexOf('[') + 1, title.indexOf(':'));
|
||||||
if ((branch.equals("master") || (TBMCCoreAPI.IsTestServer() && branch.equals("dev")))
|
if ((branch.equals("master") || (TBMCCoreAPI.IsTestServer() && branch.equals("dev")))
|
||||||
|
&& PluginUpdater.isMaven(project, branch)
|
||||||
&& TBMCCoreAPI.UpdatePlugin(project,
|
&& TBMCCoreAPI.UpdatePlugin(project,
|
||||||
new DiscordSender(null,
|
new DiscordSender(null,
|
||||||
TBMCCoreAPI.IsTestServer() //
|
TBMCCoreAPI.IsTestServer() //
|
||||||
? DiscordPlugin.chatchannel //
|
? DiscordPlugin.chatchannel //
|
||||||
: DiscordPlugin.botroomchannel),
|
: DiscordPlugin.botroomchannel),
|
||||||
branch)
|
branch)
|
||||||
&& ((Supplier<Boolean>) () -> { // Best looking code I've ever written
|
&& ((Supplier<Boolean>) () -> {
|
||||||
try {
|
try {
|
||||||
int hi, ei, prnum;
|
int hi, ei, prnum;
|
||||||
if ((hi = embed.getDescription().indexOf('#')) > -1
|
if ((hi = embed.getDescription().indexOf('#')) > -1
|
||||||
|
|
Loading…
Reference in a new issue