1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-11-25 22:32:18 +02:00

Poll: parse when sending to backend

This commit is contained in:
Gerkiz
2025-09-16 23:13:48 +02:00
parent 29dbd3f759
commit d8f12f8c11
2 changed files with 63 additions and 30 deletions

View File

@@ -4,7 +4,7 @@ local Public = {}
local notification = Discord.channel_names.scenario_notifications
--- Send a parsed message to the connected channel.
--- Send a parsed message to the named discord channel.
--- Requires at least a title and a description
---@param data table
function Public.send_notification(data)
@@ -19,6 +19,21 @@ function Public.send_notification(data)
Server.to_discord_named_parsed_embed(notification, data)
end
--- Send a parsed message to the connected channel.
--- Requires at least a title and a description
---@param data table
function Public.send_notification_connected_channel(data)
if not data or not data.title or not data.description then
return error("Title and description is required.", 2)
end
if game.tick < 10 then return end
data.tick = game.tick
Server.to_discord_embed_parsed(data)
end
--- Send a message to the connected channel.
--- Requires a title and a description
---@param scenario_name string|nil