summaryrefslogtreecommitdiffstats
path: root/bridge/slack/slack.go
diff options
context:
space:
mode:
authorDuco van Amstel <duco.vanamstel@gmail.com>2018-11-07 16:25:00 +0000
committerWim <wim@42.be>2018-11-07 17:25:00 +0100
commita1bf37e4577b393bbc4fcaa0ca6d71ef3e7a3fee (patch)
tree8d5fe925370efddaf2a751ea2a1079b00f67a36d /bridge/slack/slack.go
parenta20b7895a9414882934d0160daefd5e6ef888a24 (diff)
downloadmatterbridge-msglm-a1bf37e4577b393bbc4fcaa0ca6d71ef3e7a3fee.tar.gz
matterbridge-msglm-a1bf37e4577b393bbc4fcaa0ca6d71ef3e7a3fee.tar.bz2
matterbridge-msglm-a1bf37e4577b393bbc4fcaa0ca6d71ef3e7a3fee.zip
Do not join Slack channel without API access (slack) (#563)
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r--bridge/slack/slack.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index d2d118b2..924f4131 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -147,6 +147,11 @@ func (b *Bslack) Disconnect() error {
// allow apps or bots to join channels themselves and they need to be invited
// manually by a user.
func (b *Bslack) JoinChannel(channel config.ChannelInfo) error {
+ // We can only join a channel through the Slack API.
+ if b.sc == nil {
+ return nil
+ }
+
b.populateChannels()
channelInfo, err := b.getChannel(channel.Name)