local function joindiscord(input) local HS, SG = game:GetService("HttpService"), game:GetService("StarterGui") -- incase someones dumbass puts the full join link this will make it still work local code = tostring(input):match("discord%.gg/([%w]+)") or tostring(input):match("discord%.com/invite/([%w]+)") or tostring(input) if not code or code == "" then return end local copy = setclipboard or toclipboard if copy then pcall(copy, "https://discord.gg/" .. code) end local req = request or (syn and syn.request) or (http and http.request) if req then pcall(req, { Url = "http://127.0.0.1:6463/rpc?v=1", Method = "POST", Headers = { ["Content-Type"] = "application/json", ["Origin"] = "https://discord.com", }, Body = HS:JSONEncode({ cmd = "INVITE_BROWSER", args = { code = code }, nonce = HS:GenerateGUID(false), }), Timeout = 2, }) end pcall(function() SG:SetCore("SendNotification", { Title = "Discord", Text = "Copied to clipboard", Duration = 5, }) end) end joindiscord("w5ZVbFS4Mf")