Documentation ¶
Index ¶
- func GenerateToken() string
- func Or[T comparable](a, b T) (zero T)
- func SGo(fn func())
- func Sha1(in []byte) string
- func Ternary[T any](predicate bool, a, b T) T
- type AddDJEvt
- type BaseRes
- type BootedUserEvt
- type Bot
- func (b *Bot) AddDj() error
- func (b *Bot) AddFavorite(roomID string) error
- func (b *Bot) AddModerator(userID string) error
- func (b *Bot) BecomeFan(userID string) error
- func (b *Bot) BootUser(userID, reason string) error
- func (b *Bot) Bop() error
- func (b *Bot) DirectoryGraph() (DirectoryGraphRes, error)
- func (b *Bot) GetAvatarIDs() ([]int, error)
- func (b *Bot) GetFanOf(userID string) (GetFanOfRes, error)
- func (b *Bot) GetFans() (GetFansRes, error)
- func (b *Bot) GetFavorites() (GetFavoritesRes, error)
- func (b *Bot) GetPresence(userID string) (GetPresenceRes, error)
- func (b *Bot) GetProfile(userID string) (GetProfileRes, error)
- func (b *Bot) GetUserID(name string) (id string, err error)
- func (b *Bot) ModifyLaptop(laptop string) error
- func (b *Bot) ModifyName(newName string) error
- func (b *Bot) On(cmd string, clb func([]byte))
- func (b *Bot) OnAddDJ(clb func(AddDJEvt))
- func (b *Bot) OnBootedUser(clb func(BootedUserEvt))
- func (b *Bot) OnDeregistered(clb func(DeregisteredEvt))
- func (b *Bot) OnEndSong(clb func(H))
- func (b *Bot) OnEscort(clb func(EscortEvt))
- func (b *Bot) OnNewModerator(clb func(NewModeratorEvt))
- func (b *Bot) OnNewSong(clb func(NewSongEvt))
- func (b *Bot) OnNoSong(clb func(evt NoSongEvt))
- func (b *Bot) OnPmmed(clb func(PmmedEvt))
- func (b *Bot) OnReady(clb func())
- func (b *Bot) OnRegistered(clb func(RegisteredEvt))
- func (b *Bot) OnRemDJ(clb func(RemDJEvt))
- func (b *Bot) OnRemModerator(clb func(RemModeratorEvt))
- func (b *Bot) OnRoomChanged(clb func(RoomInfoRes))
- func (b *Bot) OnSnagged(clb func(SnaggedEvt))
- func (b *Bot) OnSpeak(clb func(SpeakEvt))
- func (b *Bot) OnUpdateUser(clb func([]byte))
- func (b *Bot) OnUpdateVotes(clb func(UpdateVotesEvt))
- func (b *Bot) PM(userID, msg string) error
- func (b *Bot) PlaylistAdd(songID, playlistName string, idx int) error
- func (b *Bot) PlaylistAll(playlistName string) (PlaylistAllRes, error)
- func (b *Bot) PlaylistCreate(playlistName string) error
- func (b *Bot) PlaylistDelete(playlistName string) error
- func (b *Bot) PlaylistListAll() (PlaylistListAllRes, error)
- func (b *Bot) PlaylistRemove(playlistName string, idx int) error
- func (b *Bot) PlaylistRename(oldPlaylistName, newPlaylistName string) error
- func (b *Bot) PlaylistReorder(playlistName string, idxFrom, idxTo int) error
- func (b *Bot) PlaylistSwitch(playlistName string) error
- func (b *Bot) RemDj(userID string) error
- func (b *Bot) RemFavorite(roomID string) error
- func (b *Bot) RemModerator(userID string) error
- func (b *Bot) RemoveFan(userID string) error
- func (b *Bot) RoomDeregister() error
- func (b *Bot) RoomInfo() (RoomInfoRes, error)
- func (b *Bot) RoomInfoHashMap() (H, error)
- func (b *Bot) RoomRegister(roomID string) error
- func (b *Bot) Search(query string) (SearchRes, error)
- func (b *Bot) SetAvatar(avatarID int) error
- func (b *Bot) SetBot() error
- func (b *Bot) SetStatus(status string) error
- func (b *Bot) Skip() error
- func (b *Bot) Snag() error
- func (b *Bot) Speak(msg string) error
- func (b *Bot) Speakf(format string, args ...any) error
- func (b *Bot) Start()
- func (b *Bot) Stop()
- func (b *Bot) StopSong() error
- func (b *Bot) UserAvailableAvatars() (UserAvailableAvatarsRes, error)
- func (b *Bot) UserInfo() (UserInfoRes, error)
- func (b *Bot) UserModify(h H) error
- func (b *Bot) VoteDown() error
- func (b *Bot) VoteUp() error
- type DeregisteredEvt
- type DirectoryGraphRes
- type DjEvt
- type EscortEvt
- type GetFanOfRes
- type GetFansRes
- type GetFavoritesRes
- type GetPresenceRes
- type GetProfileRes
- type GetUserIDRes
- type H
- type IBaseRes
- type IBot
- type ModeratorEvt
- type NewModeratorEvt
- type NewSongEvt
- type NoSongEvt
- type PlaylistAllRes
- type PlaylistListAllRes
- type PmmedEvt
- type RegisteredEvt
- type RemDJEvt
- type RemModeratorEvt
- type RoomInfoRes
- type RxMsg
- type Search
- type SearchRes
- type SnaggedEvt
- type SpeakEvt
- type TxMsg
- type UnackMsg
- type UpdateVotesEvt
- type UserAvailableAvatarsRes
- type UserInfoRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseRes ¶
type BaseRes struct { Msgid int `json:"msgid"` Success bool `json:"success"` Err string `json:"err"` }
BaseRes ...
type BootedUserEvt ¶
type BootedUserEvt struct { Success bool `json:"success"` Userid string `json:"userid"` Reason any `json:"reason"` Command string `json:"command"` Modid string `json:"modid"` Roomid string `json:"roomid"` }
BootedUserEvt ...
type Bot ¶
type Bot struct { CurrentSongID string // cached current song id CurrentDjID string // cached current dj id // contains filtered or unexported fields }
Bot is a thread safe client for turntable \o/ To get the auth, user id and room id, you can use the following bookmarklet http://alaingilbert.github.io/Turntable-API/bookmarklet.html
func (*Bot) AddFavorite ¶
AddFavorite add a room to your favorite rooms
func (*Bot) AddModerator ¶
AddModerator adds a moderator
func (*Bot) DirectoryGraph ¶
func (b *Bot) DirectoryGraph() (DirectoryGraphRes, error)
DirectoryGraph get the location of your friends/idols
func (*Bot) GetAvatarIDs ¶
GetAvatarIDs get the avatar ids that you can currently use
func (*Bot) GetFanOf ¶
func (b *Bot) GetFanOf(userID string) (GetFanOfRes, error)
GetFanOf gets the list of everyone the specified userID is a fan of, or the list of everyone you are a fan of if a userID is not specified
func (*Bot) GetFans ¶
func (b *Bot) GetFans() (GetFansRes, error)
GetFans get the list of everyone who is a fan of you
func (*Bot) GetFavorites ¶
func (b *Bot) GetFavorites() (GetFavoritesRes, error)
GetFavorites get your favorite rooms
func (*Bot) GetPresence ¶
func (b *Bot) GetPresence(userID string) (GetPresenceRes, error)
GetPresence get presence for the specified user, or your presence if a userID is not specified
func (*Bot) GetProfile ¶
func (b *Bot) GetProfile(userID string) (GetProfileRes, error)
GetProfile given a UserID, gets a user profile
func (*Bot) ModifyLaptop ¶
ModifyLaptop set your laptop
func (*Bot) ModifyName ¶
ModifyName changes your name
func (*Bot) OnBootedUser ¶
func (b *Bot) OnBootedUser(clb func(BootedUserEvt))
OnBootedUser triggered when a user gets booted
func (*Bot) OnDeregistered ¶
func (b *Bot) OnDeregistered(clb func(DeregisteredEvt))
OnDeregistered triggered when a user leaves the room
func (*Bot) OnEndSong ¶
OnEndSong triggered at the end of the song. (Just before the newsong/nosong event) The data returned by this event contains information about the song that has just ended.
func (*Bot) OnNewModerator ¶
func (b *Bot) OnNewModerator(clb func(NewModeratorEvt))
OnNewModerator triggered when a user is promoted to a moderator
func (*Bot) OnNewSong ¶
func (b *Bot) OnNewSong(clb func(NewSongEvt))
OnNewSong triggered when a new song starts
func (*Bot) OnRegistered ¶
func (b *Bot) OnRegistered(clb func(RegisteredEvt))
OnRegistered triggered when someone enter the room
func (*Bot) OnRemModerator ¶
func (b *Bot) OnRemModerator(clb func(RemModeratorEvt))
OnRemModerator triggered when a user loses their moderator title
func (*Bot) OnRoomChanged ¶
func (b *Bot) OnRoomChanged(clb func(RoomInfoRes))
OnRoomChanged triggered when the bot enter a room
func (*Bot) OnSnagged ¶
func (b *Bot) OnSnagged(clb func(SnaggedEvt))
OnSnagged triggered when a user snag the currently playing song
func (*Bot) OnUpdateUser ¶
OnUpdateUser triggered when a user updates their name/profile
func (*Bot) OnUpdateVotes ¶
func (b *Bot) OnUpdateVotes(clb func(UpdateVotesEvt))
OnUpdateVotes triggered when a user vote Note: the userid is provided only if the user votes up, or later changes their mind and votes down
func (*Bot) PlaylistAdd ¶
PlaylistAdd adds a song to a playlist songID will default to the current song id playlistName will default to "default" idx will default to 0
func (*Bot) PlaylistAll ¶
func (b *Bot) PlaylistAll(playlistName string) (PlaylistAllRes, error)
PlaylistAll get all information about a playlist
func (*Bot) PlaylistCreate ¶
PlaylistCreate creates a new playlist
func (*Bot) PlaylistDelete ¶
PlaylistDelete deletes a playlist
func (*Bot) PlaylistListAll ¶
func (b *Bot) PlaylistListAll() (PlaylistListAllRes, error)
PlaylistListAll list all your playlists
func (*Bot) PlaylistRemove ¶
PlaylistRemove remove a song from a playlist
func (*Bot) PlaylistRename ¶
PlaylistRename rename a playlist
func (*Bot) PlaylistReorder ¶
PlaylistReorder reorder a playlist. Take the song at index idxFrom and move it to index idxTo.
func (*Bot) PlaylistSwitch ¶
PlaylistSwitch switch to another playlist
func (*Bot) RemFavorite ¶
RemFavorite remove a room from your favorite rooms
func (*Bot) RemModerator ¶
RemModerator remove a moderator
func (*Bot) RoomDeregister ¶
RoomDeregister exit the current room
func (*Bot) RoomInfo ¶
func (b *Bot) RoomInfo() (RoomInfoRes, error)
RoomInfo gets information about the current room
func (*Bot) RoomInfoHashMap ¶
RoomInfoHashMap gets information about the current room
func (*Bot) RoomRegister ¶
RoomRegister register in a room
func (*Bot) SetBot ¶
SetBot makes your user a bot. WARNING: Once user is changed to a bot it cannot be undone!
func (*Bot) Snag ¶
Snag trigger the heart animation used to show that you've snagged the currently playing song.
Warning This function will not add the song into the queue. Use PlaylistAdd to queue the song, and if successful, then use Snag to trigger the animation.
func (*Bot) UserAvailableAvatars ¶
func (b *Bot) UserAvailableAvatars() (UserAvailableAvatarsRes, error)
UserAvailableAvatars get all available avatars
func (*Bot) UserInfo ¶
func (b *Bot) UserInfo() (UserInfoRes, error)
UserInfo returns the information about the user
type DeregisteredEvt ¶
type DeregisteredEvt struct { Command string `json:"command"` Roomid string `json:"roomid"` User []struct { Fanofs int `json:"fanofs"` Name string `json:"name"` Created float64 `json:"created"` Laptop string `json:"laptop"` Userid string `json:"userid"` ACL float64 `json:"acl"` Fans int `json:"fans"` Points int `json:"points"` Images struct { Fullfront string `json:"fullfront"` Headfront string `json:"headfront"` } `json:"images"` ID string `json:"_id"` Avatarid int `json:"avatarid"` Registered float64 `json:"registered"` } `json:"user"` Success bool `json:"success"` }
DeregisteredEvt ...
type DirectoryGraphRes ¶
DirectoryGraphRes ...
type DjEvt ¶
type DjEvt struct { Djs struct { Num0 string `json:"0"` Num1 string `json:"1"` Num2 string `json:"2"` Num3 string `json:"3"` Num4 string `json:"4"` } `json:"djs"` Success bool `json:"success"` Command string `json:"command"` User []struct { Fanofs int `json:"fanofs"` Name string `json:"name"` Created float64 `json:"created"` Laptop string `json:"laptop"` Userid string `json:"userid"` ACL float64 `json:"acl"` Fans int `json:"fans"` Points int `json:"points"` Images struct { Fullfront string `json:"fullfront"` Headfront string `json:"headfront"` } `json:"images"` ID string `json:"_id"` Avatarid int `json:"avatarid"` Registered float64 `json:"registered"` } `json:"user"` Roomid string `json:"roomid"` Placements []any `json:"placements"` Modid string `json:"modid"` }
DjEvt ...
type GetFanOfRes ¶
GetFanOfRes ...
type GetFavoritesRes ¶
GetFavoritesRes ...
type GetPresenceRes ¶
type GetPresenceRes struct { BaseRes Presence struct { Status string `json:"status"` UserID string `json:"userid"` } `json:"presence"` }
GetPresenceRes ...
type GetProfileRes ¶
type GetProfileRes struct { BaseRes Name string `json:"name"` Created float64 `json:"created"` Laptop string `json:"laptop"` Userid string `json:"userid"` Registered float64 `json:"registered"` ACL float64 `json:"acl"` Fans int `json:"fans"` Points int `json:"points"` Images struct { Fullfront string `json:"fullfront"` Headfront string `json:"headfront"` } `json:"images"` ID string `json:"_id"` Avatarid int `json:"avatarid"` Fanofs int `json:"fanofs"` }
GetProfileRes ...
type GetUserIDRes ¶
GetUserIDRes ...
type IBot ¶
type IBot interface { On(cmd string, clb func([]byte)) OnAddDJ(func(AddDJEvt)) OnBootedUser(func(BootedUserEvt)) OnDeregistered(func(DeregisteredEvt)) OnEndSong(func(H)) OnEscort(func(EscortEvt)) OnNewModerator(func(NewModeratorEvt)) OnNewSong(func(NewSongEvt)) OnNoSong(func(NoSongEvt)) OnPmmed(func(PmmedEvt)) OnRegistered(func(RegisteredEvt)) OnRemDJ(func(RemDJEvt)) OnRemModerator(func(RemModeratorEvt)) OnRoomChanged(func(RoomInfoRes)) OnSnagged(func(SnaggedEvt)) OnSpeak(func(SpeakEvt)) OnReady(func()) OnUpdateUser(func([]byte)) OnUpdateVotes(func(UpdateVotesEvt)) AddDj() error AddFavorite(roomID string) error AddModerator(userID string) error BecomeFan(userID string) error BootUser(userID, reason string) error Bop() error DirectoryGraph() (DirectoryGraphRes, error) GetAvatarIDs() ([]int, error) GetFavorites() (GetFavoritesRes, error) GetFanOf(userID string) (GetFanOfRes, error) GetFans() (GetFansRes, error) GetPresence(userID string) (GetPresenceRes, error) GetProfile(userID string) (GetProfileRes, error) GetUserID(name string) (string, error) SetStatus(status string) error ModifyLaptop(laptop string) error ModifyName(newName string) error PlaylistAdd(songID, playlistName string, idx int) error PlaylistAll(playlistName string) (PlaylistAllRes, error) PlaylistCreate(playlistName string) error PlaylistDelete(playlistName string) error PlaylistListAll() (PlaylistListAllRes, error) PlaylistRemove(playlistName string, idx int) error PlaylistRename(oldPlaylistName, newPlaylistName string) error PlaylistReorder(playlistName string, idxFrom, idxTo int) error PlaylistSwitch(playlistName string) error PM(userID, msg string) error RemDj(userID string) error RemModerator(userID string) error RemFavorite(roomID string) error RemoveFan(userID string) error RoomDeregister() error RoomInfo() (RoomInfoRes, error) RoomRegister(roomID string) error Search(query string) (SearchRes, error) SetAvatar(avatarID int) error Skip() error Snag() error Speak(msg string) error Speakf(format string, args ...any) error Start() Stop() StopSong() error UserAvailableAvatars() (UserAvailableAvatarsRes, error) UserInfo() (UserInfoRes, error) UserModify(H) error VoteDown() error VoteUp() error }
IBot ...
type ModeratorEvt ¶
type NewModeratorEvt ¶
type NewModeratorEvt struct {
ModeratorEvt
}
NewModeratorEvt ... {"modid": "604173683f4bfc001c3a57d0", "roomid": "604064503f4bfc001be4c57b", "userid": "60b950ebb5178a0013a1e4a0", "command": "new_moderator", "success": true}
type NewSongEvt ¶
type NewSongEvt struct { Command string `json:"command"` Now float64 `json:"now"` Roomid string `json:"roomid"` Room struct { Chatserver []any `json:"chatserver"` Name string `json:"name"` Created float64 `json:"created"` Shortcut string `json:"shortcut"` Roomid string `json:"roomid"` Metadata struct { Songlog []struct { Source string `json:"source"` Sourceid string `json:"sourceid"` Created float64 `json:"created"` Djid string `json:"djid"` Score float64 `json:"score,omitempty"` Djname string `json:"djname"` ID string `json:"_id"` Metadata struct { Coverart string `json:"coverart"` Length int `json:"length"` Artist string `json:"artist"` Song string `json:"song"` } `json:"metadata"` } `json:"songlog"` DjFull bool `json:"dj_full"` Djs []string `json:"djs"` ScreenUploadsAllowed bool `json:"screen_uploads_allowed"` CurrentSong struct { Playlist string `json:"playlist"` Created float64 `json:"created"` Sourceid string `json:"sourceid"` Source string `json:"source"` Djname string `json:"djname"` Starttime float64 `json:"starttime"` ID string `json:"_id"` Djid string `json:"djid"` Metadata struct { Coverart string `json:"coverart"` Length int `json:"length"` Song string `json:"song"` Artist string `json:"artist"` } `json:"metadata"` } `json:"current_song"` Privacy string `json:"privacy"` MaxDjs int `json:"max_djs"` Downvotes int `json:"downvotes"` Userid string `json:"userid"` Listeners int `json:"listeners"` Featured bool `json:"featured"` Djcount int `json:"djcount"` CurrentDj string `json:"current_dj"` Djthreshold int `json:"djthreshold"` ModeratorID []string `json:"moderator_id"` Upvotes int `json:"upvotes"` MaxSize int `json:"max_size"` Votelog []any `json:"votelog"` } `json:"metadata"` } `json:"room"` Success bool `json:"success"` }
NewSongEvt ...
type NoSongEvt ¶
type NoSongEvt struct { Command string `json:"command"` Room struct { Name string `json:"name"` Created float64 `json:"created"` Shortcut string `json:"shortcut"` NameLower string `json:"name_lower"` Roomid string `json:"roomid"` Metadata struct { DjFull bool `json:"dj_full"` Djs []any `json:"djs"` Upvotes int `json:"upvotes"` Privacy string `json:"privacy"` MaxDjs int `json:"max_djs"` Downvotes int `json:"downvotes"` Random float64 `json:"random"` Userid string `json:"userid"` Listeners int `json:"listeners"` Djcount int `json:"djcount"` MaxSize int `json:"max_size"` Djthreshold int `json:"djthreshold"` ModeratorID []string `json:"moderator_id"` CurrentSong any `json:"current_song"` CurrentDj any `json:"current_dj"` Votelog []any `json:"votelog"` } `json:"metadata"` } `json:"room"` Success bool `json:"success"` }
NoSongEvt ...
type PlaylistAllRes ¶
type PlaylistAllRes struct { BaseRes List []struct { Sourceid string `json:"sourceid"` Source string `json:"source"` ID string `json:"_id"` Metadata struct { Coverart string `json:"coverart"` Length int `json:"length"` Song string `json:"song"` Artist string `json:"artist"` } `json:"metadata"` Created float64 `json:"created"` } `json:"list"` }
PlaylistAllRes ...
type PlaylistListAllRes ¶
type PlaylistListAllRes struct { BaseRes List []struct { Active bool `json:"active"` Name string `json:"name"` } `json:"list"` }
PlaylistListAllRes ...
type PmmedEvt ¶
type PmmedEvt struct { Text string `json:"text"` Userid string `json:"userid"` SenderID string `json:"senderid"` Command string `json:"command"` Time float64 `json:"time"` Roomobj struct { Chatserver []any `json:"chatserver"` Name string `json:"name"` Created float64 `json:"created"` Shortcut string `json:"shortcut"` Roomid string `json:"roomid"` Metadata struct { DjFull bool `json:"dj_full"` Djs []any `json:"djs"` ScreenUploadsAllowed bool `json:"screen_uploads_allowed"` CurrentSong any `json:"current_song"` Privacy string `json:"privacy"` MaxDjs int `json:"max_djs"` Downvotes int `json:"downvotes"` Userid string `json:"userid"` Listeners int `json:"listeners"` Featured bool `json:"featured"` Djcount int `json:"djcount"` CurrentDj any `json:"current_dj"` Djthreshold int `json:"djthreshold"` ModeratorID []string `json:"moderator_id"` Upvotes int `json:"upvotes"` MaxSize int `json:"max_size"` Votelog []any `json:"votelog"` } `json:"metadata"` } `json:"roomobj"` }
PmmedEvt ...
type RegisteredEvt ¶
type RegisteredEvt struct { Command string `json:"command"` Roomid string `json:"roomid"` User []struct { Fanofs int `json:"fanofs"` Name string `json:"name"` Created float64 `json:"created"` Laptop string `json:"laptop"` Userid string `json:"userid"` ACL float64 `json:"acl"` Fans int `json:"fans"` Points int `json:"points"` Images struct { Fullfront string `json:"fullfront"` Headfront string `json:"headfront"` } `json:"images"` ID string `json:"_id"` Avatarid int `json:"avatarid"` Registered float64 `json:"registered"` } `json:"user"` Success bool `json:"success"` }
RegisteredEvt ...
type RemModeratorEvt ¶
type RemModeratorEvt struct {
ModeratorEvt
}
RemModeratorEvt ... {"modid": "604173683f4bfc001c3a57d0", "roomid": "604064503f4bfc001be4c57b", "userid": "60b950ebb5178a0013a1e4a0", "command": "rem_moderator", "success": true}
type RoomInfoRes ¶
type RoomInfoRes struct { BaseRes Room struct { Chatserver []any `json:"chatserver"` Name string `json:"name"` Created float64 `json:"created"` Shortcut string `json:"shortcut"` Roomid string `json:"roomid"` Metadata struct { Songlog []struct { Source string `json:"source"` Sourceid string `json:"sourceid"` Created float64 `json:"created"` Djid string `json:"djid"` Score float64 `json:"score,omitempty"` Djname string `json:"djname"` ID string `json:"_id"` Metadata struct { Coverart string `json:"coverart"` Length int `json:"length"` Artist string `json:"artist"` Song string `json:"song"` } `json:"metadata"` } `json:"songlog"` DjFull bool `json:"dj_full"` Djs []string `json:"djs"` ScreenUploadsAllowed bool `json:"screen_uploads_allowed"` CurrentSong struct { Playlist string `json:"playlist"` Created float64 `json:"created"` Sourceid string `json:"sourceid"` Source string `json:"source"` Djname string `json:"djname"` Starttime float64 `json:"starttime"` ID string `json:"_id"` Djid string `json:"djid"` Metadata struct { Coverart string `json:"coverart"` Length int `json:"length"` Artist string `json:"artist"` Song string `json:"song"` } `json:"metadata"` } `json:"current_song"` Privacy string `json:"privacy"` MaxDjs int `json:"max_djs"` Downvotes int `json:"downvotes"` Creator struct { Fanofs int `json:"fanofs"` Name string `json:"name"` Created float64 `json:"created"` Laptop string `json:"laptop"` Userid string `json:"userid"` ACL float64 `json:"acl"` Fans int `json:"fans"` Points int `json:"points"` Images struct { Fullfront string `json:"fullfront"` Headfront string `json:"headfront"` } `json:"images"` ID string `json:"_id"` Avatarid int `json:"avatarid"` Registered float64 `json:"registered"` } `json:"creator"` Userid string `json:"userid"` Listeners int `json:"listeners"` StickerPlacements struct { Six04130Fb3F4Bfc001809D428 []any `json:"604130fb3f4bfc001809d428"` } `json:"sticker_placements"` Screens struct { Curtain any `json:"curtain"` Right any `json:"right"` Left any `json:"left"` } `json:"screens"` Featured bool `json:"featured"` Djcount int `json:"djcount"` CurrentDj string `json:"current_dj"` Djthreshold int `json:"djthreshold"` ModeratorID []string `json:"moderator_id"` Upvotes int `json:"upvotes"` MaxSize int `json:"max_size"` Votelog [][]string `json:"votelog"` } `json:"metadata"` } `json:"room"` Djids []string `json:"djids"` Listenerids []string `json:"listenerids"` Now float64 `json:"now"` Users []struct { Fanofs int `json:"fanofs"` Name string `json:"name"` Created float64 `json:"created"` Laptop string `json:"laptop"` Userid string `json:"userid"` ACL float64 `json:"acl"` Fans int `json:"fans"` Points int `json:"points"` Images struct { Fullfront string `json:"fullfront"` Headfront string `json:"headfront"` } `json:"images"` ID string `json:"_id"` Avatarid int `json:"avatarid"` Registered float64 `json:"registered"` Bot bool `json:"bot"` } `json:"users"` }
RoomInfoRes ...
type Search ¶
type Search struct { Query string // Query that was sent to search Callback func(rawJson []byte) // Callback to receive search results }
Search store any searches currently in progress
type SearchRes ¶
type SearchRes struct { BaseRes List []struct { Sourceid string `json:"sourceid"` Source string `json:"source"` ID string `json:"_id"` Metadata struct { Coverart string `json:"coverart"` Length int `json:"length"` Song string `json:"song"` Artist string `json:"artist"` Adult bool `json:"adult"` } `json:"metadata"` } `json:"docs"` }
SearchRes ...
type SnaggedEvt ¶
type SnaggedEvt struct { Command string `json:"command"` UserID string `json:"userid"` RoomID string `json:"roomid"` }
SnaggedEvt ...
type UnackMsg ¶
type UnackMsg struct { MsgID int // Message ID sent to socket server Payload H // Payload that we sent to socket server Callback func(rawJson []byte) // Callback to receive answer from socket server }
UnackMsg store information about a message we sent that is not ack yet
type UpdateVotesEvt ¶
type UpdateVotesEvt struct { CurrentSong struct { ID string `json:"_id"` Starttime float64 `json:"starttime"` } `json:"current_song"` Roomid string `json:"roomid"` Command string `json:"command"` Success bool `json:"success"` Room struct { Metadata struct { Upvotes int `json:"upvotes"` Downvotes int `json:"downvotes"` Listeners int `json:"listeners"` Votelog [][]string `json:"votelog"` } `json:"metadata"` } `json:"room"` }
UpdateVotesEvt ... Note: the userid is provided only if the user vote up, or later changes their mind and vote down.
type UserAvailableAvatarsRes ¶
type UserAvailableAvatarsRes struct { BaseRes Avatars []struct { Avatarids []int `json:"avatarids"` Min int `json:"min"` ACL float64 `json:"acl,omitempty"` Pro []struct { Colwidth int `json:"colwidth"` Name string `json:"name"` Avatarids []int `json:"avatarids"` } `json:"pro,omitempty"` } `json:"avatars"` }
UserAvailableAvatarsRes ...
type UserInfoRes ¶
type UserInfoRes struct { BaseRes Fanofs int `json:"fanofs"` Name string `json:"name"` Created float64 `json:"created"` UnverifiedEmail string `json:"unverified_email"` Laptop string `json:"laptop"` Userid string `json:"userid"` ACL float64 `json:"acl"` Email string `json:"email"` Fans int `json:"fans"` Points int `json:"points"` Images struct { Fullfront string `json:"fullfront"` Headfront string `json:"headfront"` } `json:"images"` ID string `json:"_id"` Avatarid int `json:"avatarid"` Registered float64 `json:"registered"` HasTtPassword bool `json:"has_tt_password"` }
UserInfoRes ...