diff --git a/kdb-web/src/app/models/graphql/queries.model.ts b/kdb-web/src/app/models/graphql/queries.model.ts index 8f2fbfe2..28729570 100644 --- a/kdb-web/src/app/models/graphql/queries.model.ts +++ b/kdb-web/src/app/models/graphql/queries.model.ts @@ -41,6 +41,9 @@ export class Queries { query ServerConfigDiscordQuery($id: ID) { discord { guilds(filter: {id: $id}) { + id + name + roles { id name diff --git a/kdb-web/src/app/modules/view/server/config/components/config/config.component.ts b/kdb-web/src/app/modules/view/server/config/components/config/config.component.ts index 597ba0d7..70855220 100644 --- a/kdb-web/src/app/modules/view/server/config/components/config/config.component.ts +++ b/kdb-web/src/app/modules/view/server/config/components/config/config.component.ts @@ -91,7 +91,7 @@ export class ConfigComponent implements OnInit { } if (data[1].discord.guilds) { - const guild = data[1].discord.guilds[0]; + const guild = data[1].discord.guilds.filter(g => g.id === this.server.discordId)[0]; this.roles = guild.roles ?? undefined; this.voiceChannels = guild.channels.filter(x => x.type == ChannelType.voice) ?? undefined; this.textChannels = guild.channels.filter(x => x.type == ChannelType.text) ?? undefined;