-
Notifications
You must be signed in to change notification settings - Fork 8
ftapi
- firebase (realtime database and auth libraries)
Inits firebase app, and starts firetable. firebaseConfig should be an object containing with the following:
var firebaseConfig = {
apiKey: "xxxxxxxxxxxxxxxxxx",
authDomain: "xxxxxxxxxxxxxxxxxx.firebaseapp.com",
databaseURL: "https://xxxxxxxxxxxxxxxxxx.firebaseio.com"
};
fires for every new chat message. callback returns data on the new chat message
// example chat data
{
id: "LsEw02rY37dqP9lnCdLUsJuns9U2",
name: "matt",
time: 1587142349431,
txt: "mr wavehair keepin you quiet",
chatid: "-M582_7ryxq3bMD0oorx"
}
fires every time the userlist changes. callback returns entire userlist.
// example users list data
{
FPSkbyoRxdMBpijIuYtFZrDAK852: {
mod: true,
username: "Andrew"
},
LsEw02rY37dqP9lnCdLUsJuns9U2: {
mod: true,
supermod: true,
username: "matt"
},
OiJ7rcoNaNdvk3KlFGUJx1Fqjer2: {
hostbot: true,
mod: true,
username: "jarvis"
}
}
Will fire on every new song. Callback contains data about playing song
{
artist: "Jagwar Ma",
cid: "1vU6a7Haw78",
djid: "zc2ZsfVjZ1hlYMWtYRc9tXUG7ZJ3",
djname: "scytheria",
duration: 216,
image: "https://i.ytimg.com/vi/1vU6a7Haw78/mqdefault.jpg",
key: "-M2mTXNvadPMFi_Qed5D",
postedDate: 1359554375000,
started: 1587153700688,
title: "The Throw",
type: 1,
url: "https://www.youtube.com/watch?v=1vU6a7Haw78"
}
will fire if the hostbot sends out corrected tag info or play stats
// example tagUpdate data
{
adamData: {
artist: "Tallsaint",
last_play: "2019-11-22T00:56:45.403Z",
last_play_dj: "Chris",
playcount: "5",
track_id: 41735,
track_name: "Model Effect"
},
cid: 708643411
}
fires when the currently selected playlist is updated, or if a different playlist is selected. callback contains the playlist and the listID
Fires when user logs in, contains object with some data about user
returns listID for created list
returns trackID for added track
moves track to top of selected list. optionally, if you pass the trackID of a currently playing preview track, its new trackID will be returned in the callback
optionally, if you pass the trackID of a currently playing preview track, its new trackID will be returned in the callback
ftapi.actions.reorderList(arrayOfTrackIDs, previewTrackID[optional], previewChangeCallback[optional)
arrayOfTrackIDs should be an array of the current track IDs of the currently selected list in the order you'd like to change them to.
Optionally, if you pass the trackID of a currently playing preview track, its new trackID will be returned in the callback
Changes username of currently logged in user. Callback contains error string if username is taken or is invalid. (All usernames must range between 1 and 22 characters in length and contain only numbers 0-9, letters from a-z, and underscores). If no error string passed in callback, name change was a success!
returns the listid of the currently selected playlist