From 62e55214fc3edf75455554c6ddff366f8369b60e Mon Sep 17 00:00:00 2001 From: Zomboy Alfrir Date: Mon, 14 Jan 2019 15:27:49 -0300 Subject: Allow to bridge non-bot Discord users (discord) (#689) If you prefix a token with `User ` it'll treat is as a user token. Co-Authored-By: zomboy-alfrir --- bridge/discord/discord.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index a4eb2bfd..e6f939e6 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -61,6 +61,11 @@ func (b *Bdiscord) Connect() error { if !strings.HasPrefix(b.GetString("Token"), "Bot ") { token = "Bot " + b.GetString("Token") } + // if we have a User token, remove the `Bot` prefix + if strings.HasPrefix(b.GetString("Token"),"User ") { + token = strings.Replace(token,"Bot ","",-1) + } + b.c, err = discordgo.New(token) if err != nil { return err -- cgit v1.2.3