Skip to content

Commit

Permalink
bug修复 增加渣男语录...
Browse files Browse the repository at this point in the history
  • Loading branch information
moxuexue committed Nov 20, 2023
1 parent f8aab2d commit 25d5d9d
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 3 deletions.
39 changes: 38 additions & 1 deletion Plugins/抢群红包.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,44 @@ end
function ReceiveGroupMsg(CurrentQQ, data)

if data.MsgBody.SubMsgType == 24 then --红包类型
Go.openGroupRedBag(CurrentQQ, data)
info = Go.openGroupRedBag(CurrentQQ, data)

math.randomseed(os.time())

successIndex = math.random(1, 6)
failIndex = math.random(1, 4)
successArray = {
"谢谢老板~🙏",
"老板发财💰",
"谢谢🙏",
"谢谢大佬的红包",
"发红包的好帅😂",
"老板大发特发💰"
}
failArray = {
"群里有外挂吧?😂😂😂😂",
"卧槽 ,好多外挂.....",
"外挂可耻",
"这都是什么手速😂😂😂😂"
}

if (info.ResponseData.GetMoney == 0) then
log.notice("没抢到%s", "===========")
Go.sendGroupMsg(CurrentQQ, data, failArray[failIndex])
return 1
end

if (info.ResponseData.GetMoney > 0) then
Go.sendGroupMsg(CurrentQQ, data, successArray[successIndex])
end


str =
string.format(
"刚刚抢到了 %d",
info.ResponseData.GetMoney
)
log.notice("%s", str)
end

return 1
Expand Down
39 changes: 39 additions & 0 deletions Plugins/渣男语录.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package.path = package.path .. ";./Plugins/lib/?.lua;"
local log = require("log")
local Api = require("coreApi")
local json = require("json")
local http = require("http")
local mysql = require("mysql")
local Go = require("Fans")

function ReceiveFriendMsg(CurrentQQ, data)
return 1
end

function ReceiveGroupMsg(CurrentQQ, data)

if data.MsgHead.SenderUin == 88888888 then--防止自我复读
return 1
end

if data.MsgHead.MsgType == 82 then
if string.find(data.MsgBody.Content, "!渣男语录") then
local msg = nil
local response, error_message =
http.request(
"GET",
"https://api.lovelive.tools/api/SweetNothings/Web/1"
)
local html = response.body
local info = json.decode(html)
local msg = info.returnObj.content
Go.sendGroupMsg(CurrentQQ, data, msg)
msg = nil
end
end
return 1
end

function ReceiveEvents(CurrentQQ, data)
return 1
end
4 changes: 2 additions & 2 deletions Plugins/请求处理.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function ReceiveEvents(CurrentQQ, data)
if data.EventData.MsgHead.MsgType == 33 then
local res = Go.queryUinByUid(CurrentQQ, data.EventData.Event.Uid)
Go.Sleep(math.random(2, 5))
sendGroupMsg(CurrentQQ, 88888888, "⬅让我一起欢迎这货入坑吧"..res.ResponseData[1].Nick)
sendGroupMsg(CurrentQQ, data.EventData.MsgHead.FromUin, res.ResponseData[1].Nick.."⬅让我一起欢迎这货入坑吧")
end
end

Expand All @@ -56,7 +56,7 @@ function ReceiveEvents(CurrentQQ, data)
if data.EventData.MsgHead.MsgType == 34 then
local res = Go.queryUinByUid(CurrentQQ, data.EventData.Event.Uid)
Go.Sleep(math.random(2, 5))
sendGroupMsg(CurrentQQ, 88888888, "这货离开了我们"..res.ResponseData[1].Nick)
sendGroupMsg(CurrentQQ, data.EventData.MsgHead.FromUin, res.ResponseData[1].Nick.."这货离开了我们")
end
end

Expand Down

0 comments on commit 25d5d9d

Please sign in to comment.