API

This page provides a reference for the discord-verify SDK’s API.

verify.verify(player)

Verifies if a player is in the Discord server. This function yields until verification is complete and will only send one HTTP request if called multiple times in quick succession for the same player.

Parameters

  • player (Player): The player to verify.

Returns

  • boolean: Returns true if the player is verified, otherwise false.

Example

local isVerified = verify.verify(player)

if isVerified then
    print(player.DisplayName .. " is in the Discord server!")
else
    print(player.DisplayName .. " is NOT in the Discord server! :(")
end

Note

After a player verifies, you should save their verification status to their profile data. This prevents needing to make an HTTP request every time they join.

verify.verified

A signal that fires when a player successfully verifies.

Parameters

The callback function connected to this signal receives the following parameter:

  • player (Player): The player who was verified.

Example

verify.verified:Connect(function(player: Player)
	print(player.DisplayName .. " successfully verified!")
end)

verify.openedMenuEvent(player, values)

Tracks when the player opens the verification menu. This is used for analytics to track your verification funnel.

Parameters

  • player (Player): The player who opened the menu.
  • values (table?): An optional table of additional values to log with the event.

Example

-- Call this when the player opens the verification UI
verify.openedMenuEvent(player)