-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcomment_163.lua
More file actions
36 lines (34 loc) · 1.07 KB
/
comment_163.lua
File metadata and controls
36 lines (34 loc) · 1.07 KB
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
-- 网易云热评
local Api = require("coreApi")
local http = require("http")
local json = require("json")
function ReceiveFriendMsg(CurrentQQ, data) return 1 end
function ReceiveEvents(CurrentQQ, data, extData) return 1 end
function ReceiveGroupMsg(CurrentQQ, data)
if data.FromUserId == tonumber(CurrentQQ) then
return 1
end
if data.Content:find('网易云热评') then
local body = http.request('GET', 'https://www.mouse123.cn/api/163/api.php').body
local info = json.decode(body)
local comment = string.format(
'歌曲: %s\n歌手: %s\n评论: %s',
info.title, info.author, info.comment_content
)
Api.Api_SendMsg(
CurrentQQ,
{
toUser = data.FromGroupId,
sendToType = 2,
sendMsgType = "PicMsg",
content = comment,
groupid = 0,
atUser = 0,
picUrl = info.images,
picBase64Buf = "",
fileMd5 = ""
}
)
end
return 1
end