From e3cb665d9213a5cdc970eb8ad4db54ccb8c2cd4a Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 19 Jan 2019 20:39:58 +0100 Subject: [PATCH] Make discord user token work correctly (discord) #689 --- bridge/discord/discord.go | 4 ++-- 1 file 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)