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:
parent
46182fc4ec
commit
972ea865e0
1 changed files with 9 additions and 8 deletions
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue