Documentation
¶
Index ¶
- Constants
- Variables
- type Login
- type Message
- type Session
- func (s *Session) AuthenticateWithCredentials(email, password string) error
- func (s *Session) AuthenticateWithSessionToken(sessionToken string) error
- func (s *Session) AuthenticatedRequest(method, endpoint string, body *bytes.Buffer, result any) error
- func (s *Session) GetAuthenticatedUserInfo() (*User, error)
- func (s *Session) Logout() error
- func (s *Session) OpenAuthenticatedSocket() (*Socket, error)
- func (s *Session) SendMessage(channelId, message string) (*Message, error)
- func (s *Session) SlavartGetBotStatus() (string, error)
- func (s *Session) SlavartGetUploadUrl(downloadMessageId, requestUrl string, timeout time.Duration) (string, error)
- func (s *Session) SlavartSendDownloadCommand(url string, quality int) (*Message, error)
- func (s *Session) SlavartTryInviteUser() error
- func (s *Session) UnauthenticatedRequest(method, endpoint string, body *bytes.Buffer, result any) error
- type Socket
- type SocketMessage
- type SocketMessageUpdate
- type SocketResponse
- type User
Constants ¶
View Source
const ( SlavartBotStatusOnline = "online" SlavartBotStatusOffline = "offline" )
Variables ¶
View Source
var (
SlavartAllowedHosts = []string{
"tidal.com",
"www.qobuz.com",
"play.qobuz.com",
"open.qobuz.com",
"soundcloud.com",
"www.deezer.com",
"open.spotify.com",
"music.youtube.com",
"www.jiosaavn.com",
}
)
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Id string `json:"_id"` Nonce string `json:"nonce"` Channel string `json:"channel"` Author string `json:"author"` Webhook struct { Name string `json:"name"` Avatar string `json:"avatar"` } `json:"webhook"` Content string `json:"content"` System struct { Type string `json:"type"` Content string `json:"content"` } `json:"system"` Attachments []struct { Id string `json:"_id"` Tag string `json:"tag"` Filename string `json:"filename"` Metadata struct { Type string `json:"type"` } `json:"metadata"` ContentType string `json:"content_type"` Size int `json:"size"` Deleted bool `json:"deleted"` Reported bool `json:"reported"` MessageId string `json:"message_id"` UserId string `json:"user_id"` ServerId string `json:"server_id"` ObjectId string `json:"object_id"` } `json:"attachments"` Edited time.Time `json:"edited"` Embeds []struct { Type string `json:"type"` URL string `json:"url"` OriginalUrl string `json:"original_url"` Special struct { Type string `json:"type"` } `json:"special"` Title string `json:"title"` Description string `json:"description"` Image struct { Url string `json:"url"` Width int `json:"width"` Height int `json:"height"` Size string `json:"size"` } `json:"image"` Video struct { Url string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"video"` SiteName string `json:"site_name"` IconUrl string `json:"icon_url"` Colour string `json:"colour"` } `json:"embeds"` Mentions []string `json:"mentions"` Replies []string `json:"replies"` Reactions map[string][]string `json:"reactions"` Interactions struct { Reactions []string `json:"reactions"` RestrictReactions bool `json:"restrict_reactions"` } `json:"interactions"` Masquerade struct { Name string `json:"name"` Avatar string `json:"avatar"` Colour string `json:"colour"` } `json:"masquerade"` }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) AuthenticateWithCredentials ¶
func (*Session) AuthenticateWithSessionToken ¶
func (*Session) AuthenticatedRequest ¶
func (*Session) GetAuthenticatedUserInfo ¶
func (*Session) OpenAuthenticatedSocket ¶
func (*Session) SendMessage ¶
func (*Session) SlavartGetBotStatus ¶
func (*Session) SlavartGetUploadUrl ¶
func (*Session) SlavartSendDownloadCommand ¶
func (*Session) SlavartTryInviteUser ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
func (*Socket) DeregisterMessageChannel ¶
func (s *Socket) DeregisterMessageChannel(channel *chan SocketResponse)
func (*Socket) RegisterMessageChannel ¶
func (s *Socket) RegisterMessageChannel(channel *chan SocketResponse)
func (*Socket) StartListening ¶
func (s *Socket) StartListening()
type SocketMessage ¶
type SocketMessageUpdate ¶
type SocketResponse ¶
type User ¶
type User struct { Id string `json:"_id"` Username string `json:"username"` Discriminator string `json:"discriminator"` DisplayName string `json:"display_name"` Avatar struct { Id string `json:"_id"` Tag string `json:"tag"` Filename string `json:"filename"` Metadata struct { Type string `json:"type"` } `json:"metadata"` ContentType string `json:"content_type"` Size int `json:"size"` Deleted bool `json:"deleted"` Reported bool `json:"reported"` MessageId string `json:"message_id"` UserId string `json:"user_id"` ServerId string `json:"server_id"` ObjectId string `json:"object_id"` } `json:"avatar"` Relations []struct { Id string `json:"_id"` Status string `json:"status"` } `json:"relations"` Badges int `json:"badges"` Status struct { Text string `json:"text"` Presence string `json:"presence"` } `json:"status"` Profile struct { Content string `json:"content"` Background struct { Id string `json:"_id"` Tag string `json:"tag"` Filename string `json:"filename"` Metadata struct { Type string `json:"type"` } `json:"metadata"` ContentType string `json:"content_type"` Size int `json:"size"` Deleted bool `json:"deleted"` Reported bool `json:"reported"` MessageId string `json:"message_id"` UserId string `json:"user_id"` ServerId string `json:"server_id"` ObjectId string `json:"object_id"` } `json:"background"` } `json:"profile"` Flags int `json:"flags"` Privileged bool `json:"privileged"` Bot struct { Owner string `json:"owner"` } `json:"bot"` Relationship string `json:"relationship"` Online bool `json:"online"` }
Click to show internal directories.
Click to hide internal directories.