added slapapi

This commit is contained in:
2026-02-17 08:12:07 +11:00
parent f8090aa0cc
commit 9362448f22
14 changed files with 427 additions and 46 deletions

View 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")
}