Skip to content

Commit

Permalink
more improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kr45732 committed Jun 27, 2024
1 parent 4fd04bd commit f9dfc22
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ If you are stuck or encounter a problem in the steps below, create an issue and
- If you are self-hosted [hste](https://github.com/kr45732/hste), then HASTE_KEY should be the same as the KEY set on there
3. Databases: At the moment, there are two databases instead of a single one. You might be able to combine it into one without needing to modify code by setting both databases to the same URL, but I haven't tested that. Refer to [setup-resources](https://github.com/kr45732/skyblock-plus/tree/master/setup-resources) for schemas and database dumps. You will also need to install the [pg_trgm module](https://www.postgresql.org/docs/current/pgtrgm.html) on your databases.
- [Server Settings Schema](https://github.com/kr45732/skyblock-plus/blob/master/setup-resources/schemas.md#server-settings-schema)
- [Linked Accounts Schema](https://github.com/kr45732/skyblock-plus/blob/master/setup-resources/schemas.md#leaderboards-schema)
- [Linked Accounts Schema](https://github.com/kr45732/skyblock-plus/blob/master/setup-resources/schemas.md#linked-accounts-schema)
- [Leaderboards Schema](https://github.com/kr45732/skyblock-plus/blob/master/setup-resources/schemas.md#leaderboards-schema)
- [Cache Schema](https://github.com/kr45732/skyblock-plus/blob/master/setup-resources/schemas.md#leaderboards-schema)
- [Cache Schema](https://github.com/kr45732/skyblock-plus/blob/master/setup-resources/schemas.md#cache-schema)
4. Emojis: At the moment, there are around 90 custom emoji servers. To create your own:
- Make "IdToEmojiMappings.json" an empty JSON object
- Create and add the bot to 90 servers with the name "Skyblock Plus - Emoji Server xx" (xx is the server number starting at 1)
Expand All @@ -57,7 +57,9 @@ If you are stuck or encounter a problem in the steps below, create an issue and
- Paste the JSON output of runEmojis into the "IdToEmojiMappings.json"
5. Data repository: you will need to make your own clone of the skyblock-plus-data repository so your bot can automatically update it:
- Clone [skyblock-plus-data](https://github.com/kr45732/skyblock-plus-data)
- Create a new channel in your PRIMARY_GUILD
- Create a new channel in your PRIMARY_GUILD and set "NEU_REPO_UPDATE_CHANNEL_ID" in DevSettings.properties
- Join [Moulberry's Bush](https://discord.gg/moulberry)
- Follow "#item-repo-github" and send it to the channel you just created
6. Hardcoded constants you will need to change:
- You will need to update all emoji maps in the Constants.json from [skyblock-plus-data](https://github.com/kr45732/skyblock-plus-data/blob/main/Constants.json) with your own emojis
- Create 2 messages in a channel to be used for the scuffed event system (they will be constantly edited, so they must not be deleted). These messages Update the assignment of messageId in `com.skyblockplus.features.event.EventHandler` on L46. Update the channel on L57
Expand Down
3 changes: 3 additions & 0 deletions setup-resources/ExampleDevSettings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ 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_UPDATE_CHANNEL_ID =

# 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 setup-resources/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ Indexes:
"all_lb_username_idx" gist (username gist_trgm_ops)
```

# Cache Schemas
# Cache Schema
### guild
Used for tracking guilds for "/serverlb" command
```postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void onMessageReceived(MessageReceivedEvent event) {
return;
}

if (!IS_DEV && event.getChannel().getId().equals("869278025018114108")) {
if (!IS_DEV && event.getChannel().getId().equals(NEU_REPO_UPDATE_CHANNEL_ID)) {
String commitSha = higherDepth(
getJson("https://api.github.com/repos/NotEnoughUpdates/NotEnoughUpdates-REPO/commits?per_page=1&sha=" + getNeuBranch()),
"[0].sha",
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/skyblockplus/utils/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public class Utils {
public static String NETWORTH_BUG_REPORT_CHANNEL_ID = "";
public static String ERROR_LOG_CHANNEL_ID = "";
public static String BOT_STATUS_CHANNEL_ID = "";
public static String NEU_REPO_UPDATE_CHANNEL_ID = "";
public static TextChannel errorLogChannel;
public static ShardManager jda;
public static Database database;
Expand Down Expand Up @@ -317,6 +318,7 @@ public static void initialize() {
NETWORTH_BUG_REPORT_CHANNEL_ID = (String) appProps.get("NETWORTH_BUG_REPORT_CHANNEL_ID");
ERROR_LOG_CHANNEL_ID = (String) appProps.get("ERROR_LOG_CHANNEL_ID");
BOT_STATUS_CHANNEL_ID = (String) appProps.get("BOT_STATUS_CHANNEL_ID");
NEU_REPO_UPDATE_CHANNEL_ID = (String) appProps.get("NEU_REPO_UPDATE_CHANNEL_ID");
} catch (IOException e) {
HYPIXEL_API_KEY = System.getenv("HYPIXEL_API_KEY");
BOT_TOKEN = System.getenv("BOT_TOKEN");
Expand Down Expand Up @@ -346,6 +348,7 @@ public static void initialize() {
NETWORTH_BUG_REPORT_CHANNEL_ID = System.getenv("NETWORTH_BUG_REPORT_CHANNEL_ID");
ERROR_LOG_CHANNEL_ID = System.getenv("ERROR_LOG_CHANNEL_ID");
BOT_STATUS_CHANNEL_ID = System.getenv("BOT_STATUS_CHANNEL_ID");
NEU_REPO_UPDATE_CHANNEL_ID = System.getenv("NEU_REPO_UPDATE_CHANNEL_ID");
}
}

Expand Down

0 comments on commit f9dfc22

Please sign in to comment.