Feat: add chat.error.rate_limit

This commit is contained in:
Linventif 2025-01-22 21:54:17 +00:00
parent 5aee9272cd
commit 8231f4a9ac
3 changed files with 18 additions and 3 deletions

View File

@ -203,10 +203,17 @@ local function openReportBug()
["steps"] = elements[3]:GetText(), ["steps"] = elements[3]:GetText(),
["expected"] = elements[4]:GetText(), ["expected"] = elements[4]:GetText(),
["actual"] = elements[5]:GetText(), ["actual"] = elements[5]:GetText(),
}, function() }, function(code, body)
notification.AddLegacy(gmInte.getTranslation("report_bug.success", "Bug report sent successfully"), NOTIFY_GENERIC, 5) notification.AddLegacy(gmInte.getTranslation("report_bug.success", "Bug report sent successfully"), NOTIFY_GENERIC, 5)
frame:Close() 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
end end

View File

@ -37,7 +37,14 @@ hook.Add("PostRender", "gmInteScreenshot", function()
["screenshot"] = base64Capture, ["screenshot"] = base64Capture,
["captureData"] = captureData, ["captureData"] = captureData,
["size"] = size .. "KB" ["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) end)
function gmInte.takeScreenShot() function gmInte.takeScreenShot()

View File

@ -1,4 +1,5 @@
return { return {
["chat.error.rate_limit"] = "This interaction is being rate limited, please try again later.",
["verification.title"] = "Verification Required", ["verification.title"] = "Verification Required",
["verification.open_page"] = "Open Verification Page", ["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.", ["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.",