Added Support for Webhook Components#63
Added Support for Webhook Components#63jasonlessenich wants to merge 22 commits intoMinnDevelopment:masterfrom
Conversation
MinnDevelopment
left a comment
There was a problem hiding this comment.
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.
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.
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 |
|
|
||
| /** | ||
| * Changes the disabled status of button | ||
| * @param disabled |
There was a problem hiding this comment.
| * @param disabled | |
| * | |
| * @param disabled |
| */ | ||
|
|
||
| public interface Component extends JSONString { | ||
|
|
|
|
||
| public class Button implements ActionComponent, SingleEmojiContainer<Button> { | ||
|
|
||
| public static final int MAX_BUTTONS = 5; |
There was a problem hiding this comment.
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(); | ||
|
|
| * @see LayoutComponent#addComponent(ActionComponent) | ||
| */ | ||
| public interface ActionComponent extends Component { | ||
|
|
…onRow.java Co-authored-by: Florian Spieß <business@minn.dev>
…onRow.java Co-authored-by: Florian Spieß <business@minn.dev>
…onComponent.java Co-authored-by: Florian Spieß <business@minn.dev>
…on.java Co-authored-by: Florian Spieß <business@minn.dev>
…onent.java Co-authored-by: Florian Spieß <business@minn.dev>
…onent.java Co-authored-by: Florian Spieß <business@minn.dev>
…onent.java Co-authored-by: Florian Spieß <business@minn.dev>
…utComponent.java Co-authored-by: Florian Spieß <business@minn.dev>
…utComponent.java Co-authored-by: Florian Spieß <business@minn.dev>
…ialEmoji.java Co-authored-by: Florian Spieß <business@minn.dev>
…ialEmoji.java Co-authored-by: Florian Spieß <business@minn.dev>
…ialEmoji.java Co-authored-by: Florian Spieß <business@minn.dev>
…ctMenu.java Co-authored-by: Florian Spieß <business@minn.dev>
…ctMenu.java Co-authored-by: Florian Spieß <business@minn.dev>
…ctMenu.java Co-authored-by: Florian Spieß <business@minn.dev>
…utComponent.java Co-authored-by: Florian Spieß <business@minn.dev>
…onRow.java Co-authored-by: Florian Spieß <business@minn.dev>
|
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.