Only reacting if prod. or not master

So it won't put a checkmark on master commits if updated on a test
server
This commit is contained in:
Norbi Peti 2016-12-22 23:46:04 +01:00
parent 46182fc4ec
commit 972ea865e0

View file

@ -21,13 +21,14 @@ public class AutoUpdaterListener implements IListener<MessageReceivedEvent> {
return; return;
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"))
if (TBMCCoreAPI.UpdatePlugin(project, new DiscordSender(null, DiscordPlugin.chatchannel), branch)) && TBMCCoreAPI.UpdatePlugin(project, new DiscordSender(null, DiscordPlugin.chatchannel), branch)
try { && (!TBMCCoreAPI.IsTestServer() || !branch.equals("master")))
event.getMessage().addReaction(DiscordPlugin.DELIVERED_REACTION); try {
} catch (RateLimitException e) { // TODO: Handle event.getMessage().addReaction(DiscordPlugin.DELIVERED_REACTION);
} catch (Exception e) { } catch (RateLimitException e) { // TODO: Handle
TBMCCoreAPI.SendException("An error occured while reacting to plugin update!", e); } catch (Exception e) {
} TBMCCoreAPI.SendException("An error occured while reacting to plugin update!", e);
}
} }
} }