Fixed discord data by guild filter #1.1.0.rc4
This commit is contained in:
parent
6869c5a671
commit
f3b5cef253
@ -41,6 +41,9 @@ export class Queries {
|
|||||||
query ServerConfigDiscordQuery($id: ID) {
|
query ServerConfigDiscordQuery($id: ID) {
|
||||||
discord {
|
discord {
|
||||||
guilds(filter: {id: $id}) {
|
guilds(filter: {id: $id}) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
|
||||||
roles {
|
roles {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
@ -91,7 +91,7 @@ export class ConfigComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data[1].discord.guilds) {
|
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.roles = guild.roles ?? undefined;
|
||||||
this.voiceChannels = guild.channels.filter(x => x.type == ChannelType.voice) ?? undefined;
|
this.voiceChannels = guild.channels.filter(x => x.type == ChannelType.voice) ?? undefined;
|
||||||
this.textChannels = guild.channels.filter(x => x.type == ChannelType.text) ?? undefined;
|
this.textChannels = guild.channels.filter(x => x.type == ChannelType.text) ?? undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user