Skip to content
This repository was archived by the owner on Jan 27, 2024. It is now read-only.

Commit

Permalink
set guild banner url via env var
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Nov 8, 2022
1 parent e37da6c commit 427a6d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/main/java/app/Properties.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,19 @@ public Properties() throws IOException {
this.botDiscordId
);
this.wynnIconUrl = getProperty("wynnIconUrl");
this.guildBannerUrl = getProperty("guildBannerUrl");
this.guildBannerUrl = getEnv("GUILD_BANNER_URL", "https://wynn-guild-banner.toki317.dev/banners/");

this.logTimeZone = TimeZone.getTimeZone(getProperty("logTimeZone"));
}

private String getEnv(String name) {
return System.getenv(name);
return getEnv(name, null);
}

private String getEnv(String name, String fallback) {
String value = System.getenv(name);
if (value == null) return fallback;
return value;
}

private int getEnvInt(String name, int fallback) {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ botLogChannelsMax=4
logTimeZone=Asia/Tokyo
repositoryUrl=https://github.com/motoki317/moto-bot
githubImagesUrl=https://motoki317.github.io/images/
guildBannerUrl=https://wynn-guild-banner.herokuapp.com/banners/
mainColor=#7FE3FD
botServerInviteUrl=https://discord.gg/hdKfEeV
wynnIconUrl=https://cdn.wynncraft.com/img/ico/favicon-96x96.png

0 comments on commit 427a6d8

Please sign in to comment.