We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用gotify的http api发送消息推送
local function gotify(sender_number, content) if not config.notification_channel.gotify.enabled then return end if utils.is_empty(config.notification_channel.gotify.host) then log.warn("notification_helper", "gotify host 未填写,跳过调用gotify") return end log.info("notification_helper", "正在发送gotify通知") local request_body = { title = sender_number, priority = config.notification_channel.gotify.priority, message = content } local schema = "http" if config.notification_channel.gotify.ssl then schema = "https" end local code, headers, response_body = http.request( "POST", schema .. "://" .. config.notification_channel.gotify.host .. ":" .. config.notification_channel.gotify.port .. "/message?token=" .. config.notification_channel.gotify.app_token, { ["Content-Type"] = "application/json" }, json.encode(request_body) ).wait() if code ~= 200 then log.warn("notification_helper", "gotify发送消息失败,HTTP状态码:" .. code .. ",响应内容:" .. (response_body or "")) end log.info("notification_helper", "gotify通知发送完成") end local notification_channels = { bark = bark, luatos_notification = luatos_notification, server_chan = server_chan, ding_talk_bot = ding_talk_bot, pushplus = pushplus, telegram_bot = telegram_bot, feishu_bot = feishu_bot, wecom_bot = wecom_bot, gotify = gotify, }
config.notification_channel = { // ... gotify = { enabled = false, ssl = false, app_token = "", host = "", port = 80, priority = 5 } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用gotify的http api发送消息推送
notification_helper.lua添加
config.lua添加
The text was updated successfully, but these errors were encountered: