Fixed discord data by guild filter #1.1.0.rc4

This commit is contained in:
Sven Heidemann 2023-08-17 19:58:25 +02:00
parent 6869c5a671
commit f3b5cef253
2 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,9 @@ export class Queries {
query ServerConfigDiscordQuery($id: ID) {
discord {
guilds(filter: {id: $id}) {
id
name
roles {
id
name

View File

@ -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;