summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-01-19 20:39:58 +0100
committerWim <wim@42.be>2019-01-19 20:39:58 +0100
commite3cb665d9213a5cdc970eb8ad4db54ccb8c2cd4a (patch)
tree3a412afcb2e1409c5c06b5dd11d654b107fc55b4
parentfb713ed91bfb48c0037e489f80be85c54e69953a (diff)
downloadmatterbridge-msglm-e3cb665d9213a5cdc970eb8ad4db54ccb8c2cd4a.tar.gz
matterbridge-msglm-e3cb665d9213a5cdc970eb8ad4db54ccb8c2cd4a.tar.bz2
matterbridge-msglm-e3cb665d9213a5cdc970eb8ad4db54ccb8c2cd4a.zip
Make discord user token work correctly (discord) #689
-rw-r--r--bridge/discord/discord.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index 2d3e074b..d74ed6a6 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -50,8 +50,8 @@ func New(cfg *bridge.Config) bridge.Bridger {
func (b *Bdiscord) Connect() error {
var err error
- var token string
var guildFound bool
+ token := b.GetString("Token")
b.Log.Info("Connecting")
if b.GetString("WebhookURL") == "" {
b.Log.Info("Connecting using token")
@@ -63,7 +63,7 @@ func (b *Bdiscord) Connect() error {
}
// if we have a User token, remove the `Bot` prefix
if strings.HasPrefix(b.GetString("Token"), "User ") {
- token = strings.Replace(token, "Bot ", "", -1)
+ token = strings.Replace(b.GetString("Token"), "User ", "", -1)
}
b.c, err = discordgo.New(token)