get basic node functions

This commit is contained in:
cloudwithax 2023-03-16 11:13:12 -04:00
parent e9afd0831a
commit bce429ab48
2 changed files with 18 additions and 0 deletions

5
libs/enums.lua Normal file
View File

@ -0,0 +1,5 @@
SearchType = { YOUTUBE = "ytsearch", YOUTUBE_MUSIC = "ytmsearch", SOUNDCLOUD = "scsearch" }
return {
SearchType = SearchType
}

View File

@ -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