mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-12-24 03:25:40 +00:00
Make discord user token work correctly (discord) #689
This commit is contained in:
parent
fb713ed91b
commit
e3cb665d92
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user