Onkagu is a library of several tools to create / manage / automate your nodes, so you can your own private music server from an API or implement in your code.
with npm
npm install Shaynlink/ongaku
with yarn
yarn Shaynlink/ongaku
Start default server (port 1452)
# with npm
npm start
# with yarn
yarn start
# index
GET http://localhost:1452/
# Create node
GET http://localhost:1452/node/create
# Delete node
DELETE http://localhost:1452/node/:uuid
params -> :uuid = node uuid
# Node info
GET http://localhost:1452/node/:uuid
params -> :uuid = node uuid
# Node queue
GET http://localhost:1452/node/:uuid/queue
params -> :uuid = node uuid
# add Song
PUT http://localhost:1452/node/:uuid/queue
params -> :uuid = node uuid
body -> url = Youtube video URL
-> service = URL Service (actually only youtube)
# Remove Song
DELETE http://localhost:1452/node/:uuid/queue/:suuid
params -> :uuid = node uuid
-> :suuid = song uuid
# Info song
GET http://localhost:1452/node/:uuid/queue/:suuid
params -> :uuid = node uuid
-> :suuid = song uuid
# Player
GET http://localhost:1452/node/:uuid/player
params -> uuid = node uuid
query -> type = stream encoding
Server example
'use strict';
const {Client, content, routes} = require('ongaku');
const client = new Client({
token: false, // Default, You can add token, for requests via your API with the Authorization headers
host: '0.0.0.0', // Default, Allow connection via external network requests
port: '1452', // Default
app: content, // Default express app
route: routes, // Default
});
client.on('debug', console.log);
client.rest.createServer();
download ongaku
git clone Shaynlink/ongaku
cd ongaku
create config.js
file in test folder
'use strict';
module.exports = exports = {
token: 'Your discord token',
};
Start discord.js example
node ./test/discordjs.test.js
PREFIX: .
name | descriptions |
---|---|
join | Join channel |
play | Play music |
queue | Display 5 first songs |
nowplaying | Display info of actually song |