This isn't exactly the same as the puppet bridge, basically it removes the puppetID from the url and just works against the logged in user. There is a known errata right now where some times all channels aren't left when unbridging a guild. I figured it's more important to get some more testing on this while I try to figure that out in the mean time. Also when you call /guilds/:guildID/joinentire, it joins each channel serially. I tried to make this concurrent but I maxed out the rate limit. We can do this in the future, but again, rather get this into everyone's hands sooner rather than later. I also did the same thing with unbridge and had to revert for the same reasons. Refs #8
17 lines
268 B
Go
17 lines
268 B
Go
package bridge
|
|
|
|
import (
|
|
"github.com/bwmarrin/discordgo"
|
|
)
|
|
|
|
func channelIsBridgeable(channel *discordgo.Channel) bool {
|
|
switch channel.Type {
|
|
case discordgo.ChannelTypeGuildText:
|
|
fallthrough
|
|
case discordgo.ChannelTypeGuildNews:
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|