-
Notifications
You must be signed in to change notification settings - Fork 0
/
feat.lua
43 lines (25 loc) · 856 Bytes
/
feat.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
local moonLive = require './init'()
local client = moonLive.client
print(moonLive, client)
local token, msg = moonLive:requestToken()
print(token, 'message:', msg)
-- feel free to use these credentials and pretest the api.
client.id = 'yycm39ixe2qhxlmuhzoyj9meopv4zt'
client.secret = 'fdk4hgbdarwqpo11nnt7kekpvhye6s'
-- print(moonLive.clientId)
local token, msg = moonLive:requestToken()
print(token, msg)
print(token.authorization)
local user, msg = moonLive:getUser 'corotyest'
print(user, msg)
-- for k, v in user:__iter { raw = true } do
-- p(k, v)
-- end
print(user.id, user.__id)
local res, msg = moonLive:getChannel()
print(res, msg)
-- print(moonLive:getChannel(user))
-- local res, msg = moonLive:getChannel '0000000121212121212121212'
-- print(res, msg)
local channel = moonLive:getChannel(user)
print(channel, channel.name)