Make repository URL a property
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Bea 2023-01-16 00:41:45 +01:00
parent a28781b806
commit 8b1c1b4d04
3 changed files with 15 additions and 3 deletions

View File

@ -218,6 +218,16 @@ public class Cache
return propertiesSource.getProperty("bot.version");
}
/**
* Get the bot's source code URL.
*
* @return a String containing the base URL of the repository, including a <b>trailing slash</b>.
*/
public static String getRepositoryUrl() {
String url = propertiesSource.getProperty("repo.base_url");
return url.endsWith("/") ? url : url + "/";
}
/**
* Get the bot's global color.
*

View File

@ -105,9 +105,10 @@ public class BotInfo
embedBuilder.addField("Uptime", FormatUtil.getNiceTimeDiff(Cache.getStartupTime()), true);
// issue tracker field
String link = "[Issue tracker](" + Cache.getRepositoryUrl() + "issues)";
embedBuilder.addField("Support",
"[Issue tracker](https://git.beatrice.wtf/bea/HidekoBot/issues)",
true); //todo: we should probably make this a final field in the config class
link, true);
// bot birthday field
embedBuilder.addField("Bot age",

View File

@ -1 +1,2 @@
bot.version=${project.version}
bot.version=${project.version}
repo.base_url=https://git.beatrice.wtf/bea/HidekoBot/