A npm package for the Music API from Cato Studios
$ npm install @gaming_frame/musicapi
const musicAPI = require("@gaming_frame/musicapi");
var MusicAPI = new musicAPI();
async function doStuff() {
let song = await MusicAPI.random();
console.log(song);
// {"id":72,"title":"Firecracker","url":"https:\/\/www.youtube.com\/watch?v=_AQvXd-4tD0","genre":"fantasy bard","author":"Cami-Cat (feat. Khamydrian and more)","created_at":"2021-07-22T21:40:27.000000Z","updated_at":"2021-07-22T21:40:27.000000Z"}
}
random()
search(string)
genres()
randomFromGenre(string)
add(song)
- TOKEN REQUIRED
const musicAPI = require("@gaming_frame/musicapi");
var MusicAPI = new musicAPI("secret");
async function doStuff() {
let song = {
title: "example",
url: "https://www.youtube.com/watch/dQw4w9WgXcQ",
genre: "edm",
author: "the author"
}
let response = await MusicAPI.add(song);
console.log(response);
/*
message: 'Successfully added music video',
data: {
title: 'example',
url: 'https://www.youtube.com/watch/dQw4w9WgXcQ',
genre: 'edm',
author: 'the author',
updated_at: '2021-08-10T11:28:23.000000Z',
created_at: '2021-08-10T11:28:23.000000Z',
id: 666
} */
}