mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 14:57:33 +00:00
Feat: add chat.error.rate_limit
This commit is contained in:
parent
5aee9272cd
commit
8231f4a9ac
|
@ -203,10 +203,17 @@ local function openReportBug()
|
|||
["steps"] = elements[3]:GetText(),
|
||||
["expected"] = elements[4]:GetText(),
|
||||
["actual"] = elements[5]:GetText(),
|
||||
}, function()
|
||||
}, function(code, body)
|
||||
notification.AddLegacy(gmInte.getTranslation("report_bug.success", "Bug report sent successfully"), NOTIFY_GENERIC, 5)
|
||||
frame:Close()
|
||||
end, function() notification.AddLegacy(gmInte.getTranslation("report_bug.error.failed", "Failed to send bug report retry later"), NOTIFY_ERROR, 5) end)
|
||||
end, function(code, body)
|
||||
if code == 429 then
|
||||
gmInte.chatAddText(Color(255, 255, 255), gmInte.getTranslation("chat.error.rate_limit", "This interaction is being rate limited, please try again later."))
|
||||
return
|
||||
end
|
||||
|
||||
notification.AddLegacy(gmInte.getTranslation("report_bug.error.failed", "Failed to send bug report retry later"), NOTIFY_ERROR, 5)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -37,7 +37,14 @@ hook.Add("PostRender", "gmInteScreenshot", function()
|
|||
["screenshot"] = base64Capture,
|
||||
["captureData"] = captureData,
|
||||
["size"] = size .. "KB"
|
||||
}, function(code, body) gmInte.chatAddText(Color(255, 130, 92), gmInte.getTranslation("chat.screenshot.sent", "Screenshot sent to Discord.")) end, function(code, body) gmInte.log("Screenshot failed to send to Discord, error code: " .. code, true) end)
|
||||
}, function(code, body) gmInte.chatAddText(Color(255, 130, 92), gmInte.getTranslation("chat.screenshot.sent", "Screenshot sent to Discord.")) end, function(code, body)
|
||||
if code == 429 then
|
||||
gmInte.chatAddText(Color(255, 255, 255), gmInte.getTranslation("chat.error.rate_limit", "This interaction is being rate limited, please try again later."))
|
||||
return
|
||||
end
|
||||
|
||||
gmInte.log("Screenshot failed to send to Discord, error code: " .. code, true)
|
||||
end)
|
||||
end)
|
||||
|
||||
function gmInte.takeScreenShot()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
["chat.error.rate_limit"] = "This interaction is being rate limited, please try again later.",
|
||||
["verification.title"] = "Verification Required",
|
||||
["verification.open_page"] = "Open Verification Page",
|
||||
["verification.description"] = "Hey,\nIt looks like you haven't linked your Steam account to Discord yet. This is required to play on this server. Please click the button below to link your account.\n\nAfter you've done that, click the refresh button.",
|
||||
|
|
Loading…
Reference in New Issue
Block a user