8 Star 20 Fork 4

OOOOONLY/lua-mirai-project

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
关键词回复Pro.lua 849 Bytes
Copy Edit Raw Blame History
OOOOONLY authored 2021-08-27 14:20 +08:00 . Add script header
-- LuaMiraiScript --
-- name: 关键词回复pro
-- author: ooooonly
-- version: 1.0
-- description: 可自定义回复内容
-- /LuaMiraiScript --
-- 支持使用lua模式匹配
local responses = {
["夸我"] = function(message)
return Http.get(Quote(message) .. "https://chp.shadiao.app/api.php")
end,
["骂我"] = function(message)
return Quote(message) +
Http.get(
"https://nmsl.shadiao.app/api.php?level=min&lang=zh_cn")
end
}
local function checkResponse(message)
for k, v in pairs(responses) do
if (message:find(k)) then return v(message) end
end
return nil
end
Event.subscribe("GroupMessageEvent", function(event)
local resp = checkResponse(event.message)
if resp then event.group:sendMessage(resp) end
end)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Lua
1
https://gitee.com/ooooonly/lua-mirai-project.git
git@gitee.com:ooooonly/lua-mirai-project.git
ooooonly
lua-mirai-project
lua-mirai-project
master

Search