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
Add support for server templates #876
Conversation
Added routes to the Discord API
Created the Service for Template and edited a template route
RestTemplate entity and new method to templateservice and restclient
Added all the routes with comments.
Almost finished, need to optimise and provide access to the values.
Mostly sorted just came across an annoying error
Can now call all the values given in the template request and also fixed guild creation through template.
…iscord4J into Redstoneguy129-feature/templates
@@ -0,0 +1,214 @@ | |||
package discord4j.core.object; |
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 license header
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.
One thing on naming: Template
or GuildTemplate
? All of the specs use the latter. I think it would be good to rename the class to match.
There are also many unnecessary import and formatting changes that shouldn't be included in this PR.
Many of the classes are missing javadoc and license headers
import java.util.Optional; | ||
import java.util.function.Consumer; | ||
|
||
public class Template implements DiscordObject { |
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 javadoc
* | ||
* @return the template code (unique ID) | ||
*/ | ||
public final String getCode() { |
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.
I don't think these methods need to be final. Most of our entity classes are final, though.
} | ||
|
||
/** | ||
* Requests to delete this template while optionally specifying a reason. |
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.
Is there a way to specify the reason? (does that even show up in Audit Log?)
@@ -1368,6 +1383,18 @@ public OptionalInt getMaxMembers() { | |||
.map(data -> new ExtendedInvite(gateway, data)); | |||
} | |||
|
|||
/** | |||
* Requests to retrieve the invites of the guild. |
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.
* Requests to retrieve the invites of the guild. | |
* Requests to retrieve the templates of the guild. |
/** | ||
* Requests to retrieve the invites of the guild. | ||
* | ||
* @return A {@link Flux} that continually emits the {@link ExtendedInvite invites} of the guild. If an error is |
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.
* @return A {@link Flux} that continually emits the {@link ExtendedInvite invites} of the guild. If an error is | |
* @return A {@link Flux} that continually emits the {@link Template templates} of the guild. If an error is |
This PR is based off #831, applying requested changes: removing templates from StateHolder and rearranging some methods.
Close #791