4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-09 11:34:03 +00:00

Fix discord channel & category name clash. #860 (#861)

This commit is contained in:
Qais Patankar
2019-07-15 02:53:09 +09:00
committed by Wim
parent 1fb91c6316
commit 5551f9d56f
2 changed files with 24 additions and 6 deletions

View File

@ -95,12 +95,14 @@ func (b *Bdiscord) Connect() error {
b.channelsMutex.Lock()
for _, guild := range guilds {
if guild.Name == serverName || guild.ID == serverName {
b.channels, err = b.c.GuildChannels(guild.ID)
b.guildID = guild.ID
guildFound = true
var chans []*discordgo.Channel
chans, err = b.c.GuildChannels(guild.ID)
if err != nil {
break
}
b.channels = filterChannelsByType(chans, discordgo.ChannelTypeGuildText, false)
b.guildID = guild.ID
guildFound = true
}
}
b.channelsMutex.Unlock()