File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
src/main/java/net/javadiscord/javabot Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1616@ Data
1717@ EqualsAndHashCode (callSuper = true )
1818public class StarboardConfig extends GuildConfigItem {
19- private long channelId ;
19+ private long starboardChannelId ;
2020 private int reactionThreshold ;
2121 private List <String > emojiUnicodes = new ArrayList <>();
2222
2323 public TextChannel getStarboardChannel () {
24- return this .getGuild ().getTextChannelById (this .channelId );
24+ return this .getGuild ().getTextChannelById (this .starboardChannelId );
2525 }
2626
2727 public List <UnicodeEmoji > getEmojis () {
Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) {
4747 * @param event The {@link MessageReceivedEvent} that is fired upon sending a message.
4848 * @return Whether the message author is eligible to create new suggestions.
4949 */
50- private boolean canCreateSuggestion (MessageReceivedEvent event ) {
50+ private boolean canCreateSuggestion (@ NotNull MessageReceivedEvent event ) {
5151 if (event .getChannelType () == ChannelType .PRIVATE ) return false ;
5252 return !event .getAuthor ().isBot () && !event .getAuthor ().isSystem () && !event .getMember ().isTimedOut () &&
5353 event .getMessage ().getType () != MessageType .THREAD_CREATED &&
54- event .getChannel ().equals ( Bot .config .get (event .getGuild ()).getModerationConfig ().getSuggestionChannel () );
54+ event .getChannel ().getIdLong () == Bot .config .get (event .getGuild ()).getModerationConfig ().getSuggestionChannelId ( );
5555 }
5656
5757 /**
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public void onMessageDelete(@NotNull MessageDeleteEvent event) {
7979 StarboardRepository repo = new StarboardRepository (con );
8080 StarboardConfig config = Bot .config .get (event .getGuild ()).getStarboardConfig ();
8181 StarboardEntry entry ;
82- if (event .getChannel ().equals ( config .getStarboardChannel () )) {
82+ if (event .getChannel ().getIdLong () == config .getStarboardChannelId ( )) {
8383 entry = repo .getEntryByStarboardMessageId (event .getMessageIdLong ());
8484 } else {
8585 entry = repo .getEntryByMessageId (event .getMessageIdLong ());
You can’t perform that action at this time.
0 commit comments