4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 21:19:22 +00:00

Allow a webhookurl per channel (discord). #239

This commit is contained in:
Wim
2017-08-12 14:51:41 +02:00
parent ad4d461606
commit 28710d0bc7
14 changed files with 100 additions and 49 deletions

View File

@ -108,14 +108,14 @@ func (b *Bslack) Disconnect() error {
}
func (b *Bslack) JoinChannel(channel string) error {
func (b *Bslack) JoinChannel(channel config.ChannelInfo) error {
// we can only join channels using the API
if b.Config.WebhookURL == "" && b.Config.WebhookBindAddress == "" {
if strings.HasPrefix(b.Config.Token, "xoxb") {
// TODO check if bot has already joined channel
return nil
}
_, err := b.sc.JoinChannel(channel)
_, err := b.sc.JoinChannel(channel.Name)
if err != nil {
if err.Error() != "name_taken" {
return err