summaryrefslogtreecommitdiffstats
path: root/bridge/discord/discord.go
diff options
context:
space:
mode:
authorQais Patankar <qaisjp@gmail.com>2019-07-15 02:53:09 +0900
committerWim <wim@42.be>2019-07-14 19:53:09 +0200
commit5551f9d56f2270c58738d3d43b3f4ef82507a3b9 (patch)
tree1c39c430d7be90831c101f9039fe347bfad42552 /bridge/discord/discord.go
parent1fb91c6316f86426d62d38562f957963a522cdd1 (diff)
downloadmatterbridge-msglm-5551f9d56f2270c58738d3d43b3f4ef82507a3b9.tar.gz
matterbridge-msglm-5551f9d56f2270c58738d3d43b3f4ef82507a3b9.tar.bz2
matterbridge-msglm-5551f9d56f2270c58738d3d43b3f4ef82507a3b9.zip
Fix discord channel & category name clash. #860 (#861)
Diffstat (limited to 'bridge/discord/discord.go')
-rw-r--r--bridge/discord/discord.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index 4c1c0f46..66c8134c 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -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()