Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
Fixes and completes #8
Browse files Browse the repository at this point in the history
Includes retro-patch for incomplete data.

This may be removed in the future.
  • Loading branch information
Trip-kun committed Jul 19, 2023
1 parent e1996a6 commit d3a175b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.jetbrains.annotations.NotNull;
import wtf.triplapeeck.oatmeal.Page;
import wtf.triplapeeck.oatmeal.commands.Command;
import wtf.triplapeeck.oatmeal.listeners.ThreadManager;
import wtf.triplapeeck.oatmeal.DataCarriage;

public class SetStarboardLimit extends Command {
public SetStarboardLimit() {
Page.Essential.addCommand(this);
}
@Override
public void handler(MessageReceivedEvent event, DataCarriage carriage, ThreadManager listener) {
if (ensureAdministrator(carriage) && ensureFirstArgument(carriage)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void load() {
private @Nullable String starboardChannelID;

@Column
private @Nullable Integer starboardLimit;
private @NotNull Integer starboardLimit;

@Column(nullable = false)
private @NotNull Boolean currencyEnabled;
Expand All @@ -77,6 +77,7 @@ public MariaGuild(@NotNull String guildId) {
this.starboardLimit = null;
this.currencyEnabled = true;
this.testingEnabled = false;
this.starboardLimit=2;
}

@Deprecated
Expand Down Expand Up @@ -138,8 +139,11 @@ public synchronized void setStarboardChannelID(@Nullable String starboardChannel
this.starboardChannelID = starboardChannelID;
}

@Nullable
@NotNull
public synchronized Integer getStarboardLimit() {
if (starboardLimit==null) {
starboardLimit=2;
}
return starboardLimit;
}

Expand Down

0 comments on commit d3a175b

Please sign in to comment.