-
Notifications
You must be signed in to change notification settings - Fork 22
Add the ability to add a ⭐ to a message in the #starboard channel as well as the original message #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
@Override | ||
public void onMessageDelete(@NotNull MessageDeleteEvent event) { | ||
removeMessageFromStarboard(event.getGuild(), event.getMessageId()); | ||
} | ||
|
||
private void updateSbReactionCounts(GenericMessageReactionEvent event, StarBoardConfig config, String messageId, String remoteTextChannelId) { | ||
Objects.requireNonNull(event.getGuild().getTextChannelById(remoteTextChannelId)).retrieveMessageById(messageId).queue(message -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace Objects.requireNonNull
with a null check Objects.requireNonNull
throws exceptions
|
||
private int getUniqueStarCounts(Message starboardMessage, Message originalMessage, StarBoardConfig config){ | ||
try { | ||
List<User> list = originalMessage.retrieveReactionUsers(config.getEmotes().get(0)).takeAsync(this.getReactionCountForEmote(config.getEmotes().get(0), originalMessage)).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give these variables a valid name instead so list
private int getUniqueStarCounts(Message starboardMessage, Message originalMessage, StarBoardConfig config){ | ||
try { | ||
List<User> list = originalMessage.retrieveReactionUsers(config.getEmotes().get(0)).takeAsync(this.getReactionCountForEmote(config.getEmotes().get(0), originalMessage)).get(); | ||
List<User> list2 = starboardMessage.retrieveReactionUsers(config.getEmotes().get(0)).takeAsync(this.getReactionCountForEmote(config.getEmotes().get(0), starboardMessage)).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
src/main/java/net/javadiscord/javabot/events/StarboardListener.java
Outdated
Show resolved
Hide resolved
I'm sorry to say that, but I have to close this PR, as we're going to refactor the whole starboard to use the H2 Database. |
Issue : Ability to add a ⭐from Starboard and Original Message
Its notable that we cannot ⭐ a message directly from the starboard.
I have added the feature to vote on the message both from the starboard and the original message. With this, I have implemented it in a way that it counts a User only once even if the User votes on both the messages.
It closes the issue : Ability to add a ⭐from Starboard and Original Message