diff options
author | Qais Patankar <qaisjp@gmail.com> | 2020-11-30 05:57:16 +0000 |
---|---|---|
committer | Wim <wim@42.be> | 2020-12-13 23:19:48 +0100 |
commit | 0a17e2111921ad45251b72864cc713a120658849 (patch) | |
tree | 84804e5ba84e8ec6fb9c3d89465b2f317e154681 /bridge/discord/discord.go | |
parent | 52e2f926f423295dbf95463218bed6abd94d574a (diff) | |
download | matterbridge-msglm-0a17e2111921ad45251b72864cc713a120658849.tar.gz matterbridge-msglm-0a17e2111921ad45251b72864cc713a120658849.tar.bz2 matterbridge-msglm-0a17e2111921ad45251b72864cc713a120658849.zip |
Remove WebhookURL support (discord)
Diffstat (limited to 'bridge/discord/discord.go')
-rw-r--r-- | bridge/discord/discord.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 1a3af929..78c579ae 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -43,14 +43,7 @@ func New(cfg *bridge.Config) bridge.Bridger { b.nickMemberMap = make(map[string]*discordgo.Member) b.channelInfoMap = make(map[string]*config.ChannelInfo) - // If WebhookURL is set to anything, we assume preference for autoWebhooks - // - // Legacy note: WebhookURL used to have an actual webhook URL that we would edit, - // but we stopped doing that due to Discord making rate limits more aggressive. - // - // We're keeping the same setting for now, and we will late deprecate this setting - // in favour of a new setting, something like "AutoWebhooks=true" - b.useAutoWebhooks = b.GetString("WebhookURL") != "" + b.useAutoWebhooks = b.GetBool("AutoWebhooks") if b.useAutoWebhooks { b.Log.Debug("Using automatic webhooks") } @@ -147,6 +140,19 @@ func (b *Bdiscord) Connect() error { return err } + // Legacy note: WebhookURL used to have an actual webhook URL that we would edit, + // but we stopped doing that due to Discord making rate limits more aggressive. + // + // Even older: the same WebhookURL used to be used by every channel, which is usually unexpected. + // This is no longer possible. + if b.GetString("WebhookURL") != "" { + message := "The global WebhookURL setting has been removed. " + message += "You can get similar \"webhook editing\" behaviour by replacing this line with `AutoWebhooks=true`. " + message += "If you rely on the old-OLD (non-editing) behaviour, can move the WebhookURL to specific channel sections." + b.Log.Errorln(message) + return fmt.Errorf("use of removed WebhookURL setting") + } + // Initialise webhook management b.transmitter = transmitter.New(b.c, b.guildID, "matterbridge", b.useAutoWebhooks) b.transmitter.Log = b.Log |