mirror of https://github.com/cloudwithax/flare.git
get basic node functions
This commit is contained in:
parent
e9afd0831a
commit
bce429ab48
|
|
@ -0,0 +1,5 @@
|
|||
SearchType = { YOUTUBE = "ytsearch", YOUTUBE_MUSIC = "ytmsearch", SOUNDCLOUD = "scsearch" }
|
||||
|
||||
return {
|
||||
SearchType = SearchType
|
||||
}
|
||||
|
|
@ -4,9 +4,11 @@ local http = require('coro-http')
|
|||
local json = require('json')
|
||||
local querystring = require('querystring')
|
||||
local utils = require('utils')
|
||||
local enums = require('enums')
|
||||
local interp = utils.interp
|
||||
local split = utils.split
|
||||
local dump = utils.dump
|
||||
local SearchType = enums.SearchType
|
||||
|
||||
local Emitter = discordia.Emitter
|
||||
local class = discordia.class
|
||||
|
|
@ -154,4 +156,15 @@ function Node:_send(method, path, _guild_id, _query, _data, include_version)
|
|||
end
|
||||
end
|
||||
|
||||
function Node:get_tracks(_query, search_type)
|
||||
if not self._connected then return end
|
||||
assert(type(search_type) == type(SearchType), "Search type is not valid")
|
||||
|
||||
local query = search_type .. ":" .. _query
|
||||
|
||||
print(query)
|
||||
|
||||
-- local tracks = self:_send('GET', 'loadtracks', nil, '')
|
||||
end
|
||||
|
||||
return Node
|
||||
|
|
|
|||
Loading…
Reference in New Issue