(deprecated) A guide on using the Ro-Ver API within your game

Update: RoVer has disabled the RBX2DISC part of their API because it was a major privacy issue.

What is Ro-Ver?
Ro-Ver is a bot often used in discord servers for users to verify their ROBLOX NAME to their DISCORD ACCOUNT the purpose for this is to give users proper roles and validate who they are.

What could I use this for?
You could use this to display peoples discord username#discriminator in-game (WITH THEIR PERMISSION OF COURSE) or just to get peoples discord usernames.

Things you need:
-Some knowledge of lua
-A discord bot token (look it up)

How do I use this?
Well for my use I wanted to print a player who clicks a button’s username # discriminator to the developer console so I did the following:
I created a RemoteFunction in Replicated Storage named “RBX2DISC”, after that I created a script in ServerScriptService with the following written inside:

local HttpService = game:GetService("HttpService") --http service reference
local auth = {
	["Authorization"] = "Bot YOUR_TOKEN_HERE" --put your bot token here
	}

game.ReplicatedStorage["RBX2DISC"].OnServerInvoke:Connect(function(player,contents) 
	local url = "https://verify.eryn.io/api/roblox/" -- ro-ver api
	local userid = game.Players:GetUserIdFromNameAsync(contents) --get players userid from their username
	local response = HttpService:GetAsync(url..tostring(userid)) --sends a request to the ro ver api with the userid
	local data = HttpService:JSONDecode(response) --decodes the json so it can be interacted with easily
	
	if data.status == "ok" then --checks if everything went good
		print(contents.." owns the following discord accounts:") --self explanitory
		for i,discid in pairs(data.users) do --data.users could be a table with multiple values if a user owns one than more account
			local discord = DiscID2DiscCrim(discid) --calls the DiscID2DiscCrim function (read that before continuing)
			print(discord.." (ID: "..discid..")") --prints the users username # discriminator and their userid to the developer console
		end
	end
end)

function DiscID2DiscCrim(ID) --paramters 
	local url = "https://discordapp.com/api/users/" --discord api
	local response = HttpService:GetAsync(url..ID,false,auth) --sends a web request to the discord api asking them for information about the user with that ID
	local data = HttpService:JSONDecode(response)--decodes the data again
	return data.username.."#"..data.discriminator --returns the username # discriminator of the user (back to line 16 now)
end

Anyways I hope some of you find this useful, tomorrow I’ll be adding on how to use a players discord ID to get their roblox username.

3 Likes

This topic was automatically closed after 1 minute. New replies are no longer allowed.