Secrets not properly working

Hello everyone!

Hope everyone’s having a good day.

Recently, I was working on my SecurityManager module script,. however now the engine is unable to properly recognise my hook url which is responsible for sending a piece of data to my discord webhook.

When I use the raw webhook, including token and all, it works fine. However, when I use Secrets, and the method pertaining to it it refuses to work. “HttpError: InvalidUrl”

local key = HttpService:GetSecret("VANGUARD_AUTOMATIC_SECURITY")
local baseUrl = "https://webhook.lewisakura.moe/api/webhooks/"

local CONSTANTS = {
    MAX_STRIKES = 3,
    WEBHOOK_URL = key:AddPrefix(baseUrl),
    NOTIFICATION_THRESHOLD = 2, -- Minimum strike severity to trigger Discord notification
}

Any help is greatly appreciated.

key should be just WEBHOOK_ID/WEBHOOK_TOKEN, is it in that format?

1 Like

Yes it is, (character limit). adnadna

have you tried constructing the new url manually?
like - baseUrl .. key

or you maybe getting wrong Secret or just mussing some symbols in the final url

Secrets are unable to be concatenated with strings.

It keeps giving me an invalid url error…

Okay, I have finally made it work.

Even though I have registered the secret locally through settings, it keeps giving me a invalid URL error.

What fixed it for me is by actually testing it within the actual game on roblox, and not the studio environment.

Thanks to everyone who contributed.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.