-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements for Forward and PartialMessageData
- Created PartialMessageUpdateData for the Update Message response - Include test for forward message response - Fixes for PartialMessageData used in Forward
- Loading branch information
Showing
5 changed files
with
94 additions
and
7 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
src/main/java/discord4j/discordjson/json/PartialMessageUpdateData.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,23 @@ | ||
package discord4j.discordjson.json; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import discord4j.discordjson.Id; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonSerialize(as = ImmutablePartialMessageUpdateData.class) | ||
@JsonDeserialize(as = ImmutablePartialMessageUpdateData.class) | ||
public interface PartialMessageUpdateData extends PartialMessageData { | ||
|
||
static ImmutablePartialMessageUpdateData.Builder builder() { | ||
return ImmutablePartialMessageUpdateData.builder(); | ||
} | ||
|
||
Id id(); | ||
|
||
@JsonProperty("channel_id") | ||
Id channelId(); | ||
|
||
} |
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
55 changes: 55 additions & 0 deletions
55
src/test/resources/rest/CreateMessageWithForwardResponse.json
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,55 @@ | ||
{ | ||
"type": 0, | ||
"content": "", | ||
"mentions": [], | ||
"mention_roles": [], | ||
"attachments": [], | ||
"embeds": [], | ||
"timestamp": "2024-08-31T02:38:50.292000+00:00", | ||
"edited_timestamp": null, | ||
"flags": 16384, | ||
"components": [], | ||
"id": "1279269138510118913", | ||
"channel_id": "1088465252804481025", | ||
"author": { | ||
"id": "719574575557509202", | ||
"username": "DoggoFN", | ||
"avatar": "ca9e2a158768a8e7e38861c16c575ffb", | ||
"discriminator": "9425", | ||
"public_flags": 0, | ||
"flags": 0, | ||
"bot": true, | ||
"banner": null, | ||
"accent_color": null, | ||
"global_name": null, | ||
"avatar_decoration_data": null, | ||
"banner_color": null, | ||
"clan": null | ||
}, | ||
"pinned": false, | ||
"mention_everyone": false, | ||
"tts": false, | ||
"message_reference": { | ||
"type": 1, | ||
"channel_id": "1088465252804481025", | ||
"message_id": "1265424582311936060", | ||
"guild_id": "405699020564987914" | ||
}, | ||
"position": 0, | ||
"message_snapshots": [ | ||
{ | ||
"message": { | ||
"type": 0, | ||
"content": "What is Lorem Ipsum?\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", | ||
"mentions": [], | ||
"mention_roles": [], | ||
"attachments": [], | ||
"embeds": [], | ||
"timestamp": "2024-07-23T21:45:30.875000+00:00", | ||
"edited_timestamp": null, | ||
"flags": 0, | ||
"components": [] | ||
} | ||
} | ||
] | ||
} |