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 <zomboy@dancodes.com.ar>
This commit is contained in:
parent
464d27ad7e
commit
62e55214fc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue