Skip to content

Commit 07b19de

Browse files
committed
Fix getNotifications method
1 parent ef3d844 commit 07b19de

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/com/namelessmc/NamelessAPI/NamelessPlayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public List<Notification> getNotifications() throws NamelessException {
223223
final List<Notification> notifications = new ArrayList<>();
224224

225225
final JsonObject object = request.getResponse();
226-
object.getAsJsonArray().forEach((element) -> {
226+
object.getAsJsonArray("notifications").forEach((element) -> {
227227
final String message = element.getAsJsonObject().get("message").getAsString();
228228
final String url = element.getAsJsonObject().get("url").getAsString();
229229
final NotificationType type = NotificationType.fromString(element.getAsJsonObject().get("type").getAsString());

src/com/namelessmc/NamelessAPI/Notification.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public NotificationType getType() {
2525
}
2626

2727
public static enum NotificationType {
28-
28+
29+
TAG,
2930
MESSAGE,
3031
LIKE,
3132
PROFILE_COMMENT,

0 commit comments

Comments
 (0)