-
Notifications
You must be signed in to change notification settings - Fork 33
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
Added Support for Webhook Components #63
Added Support for Webhook Components #63
Conversation
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.
Looking good already, but will need some work.
In general the documentation should always include a description, even for getters. This is useful because it shows directly next to the method in the javadoc html.
You should check your file encoding to make sure my name actually shows up correctly, it is Spieß which includes a non-ascii letter.
You generally only add support for sending components, not getting them from existing messages via ReadonlyMessage
. This is not a huge deal to me though, and I can just add that later myself. But I wanted to point that out regardless.
* @throws java.lang.NullPointerException | ||
* If provided with null | ||
* @throws java.lang.IllegalStateException | ||
* If more than {@value LayoutComponent#MAX_COMPONENTS} are added |
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.
Throws docs should be after param and before return:
/*
* description text ...
*
* @param ...
* description
*
* @throws ...
* description
*
* @return ...
*/
.collect(Collectors.toList())); | ||
mentions.getRoles().stream() | ||
.map(Role::getId) | ||
.collect(Collectors.toList())); |
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.
Why was all this indentation changed?
src/main/java/club/minnced/discord/webhook/send/component/ActionComponent.java
Outdated
Show resolved
Hide resolved
void withDisabled(boolean disabled); | ||
|
||
/** | ||
* @return true if the button is disabled |
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.
Missing description
|
||
/** | ||
* Changes the disabled status of button | ||
* @param disabled |
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.
* @param disabled | |
* | |
* @param disabled |
*/ | ||
|
||
public interface Component extends JSONString { | ||
|
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.
|
||
public class Button implements ActionComponent, SingleEmojiContainer<Button> { | ||
|
||
public static final int MAX_BUTTONS = 5; |
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.
Move this into LayoutComponent
src/main/java/club/minnced/discord/webhook/send/component/ActionRow.java
Outdated
Show resolved
Hide resolved
* @return true if the button is disabled | ||
*/ | ||
boolean isDisabled(); | ||
|
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.
* @see LayoutComponent#addComponent(ActionComponent) | ||
*/ | ||
public interface ActionComponent extends Component { | ||
|
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.
…onRow.java Co-authored-by: Florian Spieß <[email protected]>
…onRow.java Co-authored-by: Florian Spieß <[email protected]>
…onComponent.java Co-authored-by: Florian Spieß <[email protected]>
…on.java Co-authored-by: Florian Spieß <[email protected]>
…onent.java Co-authored-by: Florian Spieß <[email protected]>
…onent.java Co-authored-by: Florian Spieß <[email protected]>
…onent.java Co-authored-by: Florian Spieß <[email protected]>
…utComponent.java Co-authored-by: Florian Spieß <[email protected]>
…utComponent.java Co-authored-by: Florian Spieß <[email protected]>
…ialEmoji.java Co-authored-by: Florian Spieß <[email protected]>
…ialEmoji.java Co-authored-by: Florian Spieß <[email protected]>
…ialEmoji.java Co-authored-by: Florian Spieß <[email protected]>
…ctMenu.java Co-authored-by: Florian Spieß <[email protected]>
…ctMenu.java Co-authored-by: Florian Spieß <[email protected]>
…ctMenu.java Co-authored-by: Florian Spieß <[email protected]>
…utComponent.java Co-authored-by: Florian Spieß <[email protected]>
…onRow.java Co-authored-by: Florian Spieß <[email protected]>
Continuing this in #73 |
This PR attempts to add Webhook Components. (Closes #46)
I've mainly just copied all changes from RohanGoyalDev's PR (#56) and fixed all the remaining issues.