i got this code that take webhook message but i dont understand the pattern matching behind it
function getContent(link)
cmd = io.popen('powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Write-Host (Invoke-WebRequest -Uri "'..link..'").Content"')
return cmd:read("*all"):match('"description": "(.+)"}],')
end
function blabla(a)
link= webhookLink.."/messages/"..messageId
text = [[
$webHookUrl = "]]..link..[["
$embedObject = @{
description = "]]..getContent(link):gsub("\\([nt])", {n="\n", t="\t"})..[[`n]]..a..[["
}
$embedArray = @($embedObject)
$payload = @{
embeds = $embedArray
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri $webHookUrl -Body ($payload | ConvertTo-Json -Depth 4) -Method Patch -ContentType 'application/json'
]]
file = io.popen("powershell -command -", "w")
file:write(text)
file:close()
end
My question is what does "(.+)"}]
mean in the getContent
function and ]]..getContent(link):gsub("\\([nt])", {n="\n", t="\t"})..[[
n]]..a..[[in
blabla` function ?