mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-22 17:30:26 +00:00
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 ") {
|
if !strings.HasPrefix(b.GetString("Token"), "Bot ") {
|
||||||
token = "Bot " + b.GetString("Token")
|
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)
|
b.c, err = discordgo.New(token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user