-
-
Notifications
You must be signed in to change notification settings - Fork 262
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 methods for getting, editing, and deleting a message via webhook. #1026
Add methods for getting, editing, and deleting a message via webhook. #1026
Conversation
* Modify channel hierarchy in preparation for threads * Use 'TopLevel' names instead of temp names, remove duplicate docs * Add deprecation docs * Add class docs * Make CategorizableChannel extend TopLevelGuildChannel * Make breaking channel hierarchy changes * (Re)move methods deprecated in preparation for threads * Move most base channel method implementations to default methods * Remove most base channel classes * Don't deprecate GuildChannel#getEffectivePermissions * Remove BaseTopLevelGuildChannel, add license headers, docs * Remove unused imports * Remove unused imports Co-authored-by: quanticc <abarcab.ivan@gmail.com>
* Initial work on threads * More work on threads * Modify channel hierarchy in preparation for threads * Use 'TopLevel' names instead of temp names, remove duplicate docs * Add deprecation docs * Add class docs * Make CategorizableChannel extend TopLevelGuildChannel * Make breaking channel hierarchy changes * (Re)move methods deprecated in preparation for threads * Move most base channel method implementations to default methods * Remove most base channel classes * Don't deprecate GuildChannel#getEffectivePermissions * Remove BaseTopLevelGuildChannel, add license headers, docs * Remove unused imports * Remove unused imports * Use new channel hierarchy
Add spec/mono generators for editing and deleting a message via webhook. Add new interface VoidSpec that provides a default implementation of asRequest that returns null.
Remove WebhookMessageDeleteSpecGenerator.java Add Webhook#executeMessageGet
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 haven't read through all of this closely yet, just noticed the license headers missing on new files
core/src/main/java/discord4j/core/spec/WebhookMessageDeleteSpecGenerator.java
Outdated
Show resolved
Hide resolved
core/src/main/java/discord4j/core/spec/WebhookMessageEditSpecGenerator.java
Show resolved
Hide resolved
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.
Thanks for adding this. I have a small request, can you rename the methods in Webhook to:
- getMessage
- editMessage
- deleteMessage
@quanticc thanks, the method names have been updated now. Should the name of WebhookMessageEditSpec and Mono be updated as well? To WebhookEditMessageSpec and Mono |
Dang I merged master in. I'll revert that tomorrow when I'm not on my phone lol |
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.
Thanks!
Description:
Adds 3 missing helper methods in the
Webhook
class:getMessage()
editMessage()
deleteMessage()
Adds
WebhookMessageEditSpecGenerator
andWebhookMessageEditMonoGenerator
to support new methodsJustification:
These documented routes already exist in the
WebhookService
, but have not yet been added to theWebhook
class for easier execution.Note:
When creating the spec/mono generator, I may have broken some conventions, so please advise any changes I should make. Particularly for this reason:
Webhook#editMessage
accept themessageId
as a required parameter, separately from theWebhookMessageEditSpec
, since the call will not work without one? As it is now, the messageId has to be set in the spec, and then it is validated to be non-null upon execution. Or, because messageId is a path variable rather than a member of the request body, should it even be included in the spec at all? For example, the 2 webhook fields aren't included in the spec.Thanks for your consideration.