Skip to content

Commit

Permalink
Fix not loading the guild reference when updating channel object
Browse files Browse the repository at this point in the history
  • Loading branch information
SNWCreations committed Jul 29, 2024
1 parent bec3cd9 commit c22a68c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/snw/kookbc/impl/entity/channel/ChannelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ public void update(JsonObject data) {
// basic information
String name = get(data, "name").getAsString();
boolean isPermSync = get(data, "permission_sync").getAsInt() != 0;

final String guildId = get(data, "guild_id").getAsString();
final Guild theGuild = client.getCore().getHttpAPI().getGuild(guildId);
// rpo parse
Collection<RolePermissionOverwrite> rpo = new ArrayList<>();
for (JsonElement element : get(data, "permission_overwrites").getAsJsonArray()) {
Expand Down Expand Up @@ -351,6 +354,7 @@ public void update(JsonObject data) {

this.name = name;
this.permSync = isPermSync;
this.guild = theGuild;
this.rpo = rpo;
this.upo = upo;

Expand Down

0 comments on commit c22a68c

Please sign in to comment.