-
Notifications
You must be signed in to change notification settings - Fork 4
/
dog.lua
32 lines (29 loc) · 915 Bytes
/
dog.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
-- dog => 舔狗日记
local Api = require("coreApi")
local http = require("http")
function ReceiveFriendMsg(CurrentQQ, data) return 1 end
function ReceiveEvents(CurrentQQ, data, extData) return 1 end
local urls = {
"http://www.vizy8.cn/api2/tgrj/api.php",
"http://test.isiyuan.net/tiangou/tg.php"
}
function ReceiveGroupMsg(CurrentQQ, data)
if data.FromUserId == tonumber(CurrentQQ) then
return 1
end
if data.Content == 'dog' or data.Content == '舔狗日记' then
math.randomseed(os.time())
Api.Api_SendMsg(
CurrentQQ,
{
toUser = data.FromGroupId,
sendToType = 2,
sendMsgType = "TextMsg",
groupid = 0,
content = '\n'..http.request('GET', urls[math.random(1,#urls)]).body,
atUser = data.FromUserId
}
)
end
return 1
end