added slapapi
This commit is contained in:
18
internal/discord/steamid.go
Normal file
18
internal/discord/steamid.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package discord
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (s *OAuthSession) GetSteamID() (string, error) {
|
||||
connections, err := s.UserConnections()
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "s.UserConnections")
|
||||
}
|
||||
for _, conn := range connections {
|
||||
if conn.Type == "steam" {
|
||||
return conn.ID, nil
|
||||
}
|
||||
}
|
||||
return "", errors.New("steam connection not found")
|
||||
}
|
||||
Reference in New Issue
Block a user