Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix allowed mentions checkstyle Fixes add fixes
- Loading branch information
Showing
12 changed files
with
778 additions
and
613 deletions.
There are no files selected for viewing
522 changes: 6 additions & 516 deletions
522
javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java
Large diffs are not rendered by default.
Oops, something went wrong.
540 changes: 540 additions & 0 deletions
540
javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilderBase.java
Large diffs are not rendered by default.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
javacord-api/src/main/java/org/javacord/api/entity/message/MessageUpdater.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.javacord.api.entity.message; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class MessageUpdater extends MessageBuilderBase<MessageUpdater> { | ||
/** | ||
* The message to update. | ||
*/ | ||
private final Message message; | ||
|
||
/** | ||
* Class constructor. | ||
* | ||
* @param m The message to update. | ||
*/ | ||
public MessageUpdater(Message m) { | ||
super(MessageUpdater.class); | ||
delegate.copy(m); | ||
this.message = m; | ||
} | ||
|
||
/** | ||
* Edits the message, updating all fields that have been changed by a method call. | ||
* For example, the content of the message will only be patched if you called a method on this updater | ||
* that affects the content. | ||
* | ||
* @return The edited message. | ||
*/ | ||
public CompletableFuture<Message> applyChanges() { | ||
return delegate.edit(message, true); | ||
} | ||
|
||
/** | ||
* Edits the message, updating all fields. | ||
* Fields that have not been set will be dropped and removed from the actual message on Discord. | ||
* | ||
* @return The edited message. | ||
*/ | ||
public CompletableFuture<Message> replaceMessage() { | ||
return delegate.edit(message, false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.