Skip to content

Commit

Permalink
more env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kr45732 committed Jun 27, 2024
1 parent 97e0e46 commit 1efd7b2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions setup-resources/ExampleDevSettings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ BOT_STATUS_CHANNEL_ID =
# text channel in PRIMARY_GUILD where networth bug reports are logged to
NETWORTH_BUG_REPORT_CHANNEL_ID =

# text channel where NEU-repo updates are forward to (see step 6 in README)
# text channel where NEU-repo updates are forwarded to (see step 6 in README)
NEU_REPO_UPDATE_CHANNEL_ID =

# GitHub link to your clone of https://github.com/kr45732/skyblock-plus-data formatted as is "username/repo" (e.g. "kr45732/skyblock-plus-data")
# text channel where your self-hosted https://github.com/kr45732/rust-query-api webhook logs too
QUERY_API_LOG_CHANNEL_ID =

# GitHub link to your clone of https://github.com/kr45732/skyblock-plus-data formatted as "username/repo" (e.g. "kr45732/skyblock-plus-data")
DATA_REPO_GITHUB =

# email used for automatic GitHub commits in the data repo (e.g. "[email protected]")
GITHUB_EMAIL =

# used for prefix commands (mainly dev commands)
# requires message content intent to be enabled to use prefix
# if you don't have the message content intent & want to use prefix commands, then just mention the bot instead of a prefix
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/skyblockplus/utils/AuctionFlipper.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class AuctionFlipper {

public static void onGuildMessageReceived(MessageReceivedEvent event) {
try {
if (event.getChannel().getId().equals("958771784004567063") && event.isWebhookMessage()) {
if (event.getChannel().getId().equals(QUERY_API_LOG_CHANNEL_ID) && event.isWebhookMessage()) {
String desc = event.getMessage().getEmbeds().get(0).getDescription();
if (desc.contains(" query auctions into database in ")) {
resetQueryItems();
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/com/skyblockplus/utils/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ public class Utils {
public static String BOT_STATUS_CHANNEL_ID = "";
public static String NEU_REPO_UPDATE_CHANNEL_ID = "";
public static String DATA_REPO_GITHUB = "";
public static String GITHUB_EMAIL = "";
public static String QUERY_API_LOG_CHANNEL_ID = "";
public static TextChannel errorLogChannel;
public static ShardManager jda;
public static Database database;
Expand Down Expand Up @@ -321,6 +323,8 @@ public static void initialize() {
BOT_STATUS_CHANNEL_ID = (String) appProps.get("BOT_STATUS_CHANNEL_ID");
NEU_REPO_UPDATE_CHANNEL_ID = (String) appProps.get("NEU_REPO_UPDATE_CHANNEL_ID");
DATA_REPO_GITHUB = (String) appProps.get("DATA_REPO_GITHUB");
GITHUB_EMAIL = (String) appProps.get("GITHUB_EMAIL");
QUERY_API_LOG_CHANNEL_ID = (String) appProps.get("QUERY_API_LOG_CHANNEL_ID");
} catch (IOException e) {
HYPIXEL_API_KEY = System.getenv("HYPIXEL_API_KEY");
BOT_TOKEN = System.getenv("BOT_TOKEN");
Expand Down Expand Up @@ -352,6 +356,8 @@ public static void initialize() {
BOT_STATUS_CHANNEL_ID = System.getenv("BOT_STATUS_CHANNEL_ID");
NEU_REPO_UPDATE_CHANNEL_ID = System.getenv("NEU_REPO_UPDATE_CHANNEL_ID");
DATA_REPO_GITHUB = System.getenv("DATA_REPO_GITHUB");
GITHUB_EMAIL = System.getenv("GITHUB_EMAIL");
QUERY_API_LOG_CHANNEL_ID = System.getenv("QUERY_API_LOG_CHANNEL_ID");
}
}

Expand Down Expand Up @@ -871,8 +877,8 @@ public static void updateDataRepo() {
skyblockPlusDataRepo
.commit()
.setAllowEmpty(false)
.setAuthor("kr45732", "[email protected]")
.setCommitter("kr45732", "[email protected]")
.setAuthor("Skyblock Plus", GITHUB_EMAIL)
.setCommitter("Skyblock Plus", GITHUB_EMAIL)
.setMessage("Automatic update (" + neuRepo.log().setMaxCount(1).call().iterator().next().getName() + ")")
.call();
skyblockPlusDataRepo.push().setCredentialsProvider(new UsernamePasswordCredentialsProvider(GITHUB_TOKEN, "")).call();
Expand Down

0 comments on commit 1efd7b2

Please sign in to comment.