Server exports

Social apps

Server exports that read social accounts and set the verified badge.

app is the id of a social app, such as 'chirp', 'pixl' or 'flame'. See Social apps. The Live app has its own exports in Other (server).

#GetSocialAccount

Returns a social account, by its username.

lua---@param app string
---@param username string
---@return table|nil account
exports['fx-phone']:GetSocialAccount(app, username)
lualocal account = exports['fx-phone']:GetSocialAccount('chirp', 'renkaya')
  • The account: { username, displayName, bio, avatar, banner, verified, followers, following, posts, createdAt, identifier }. identifier is the character that owns it.

#GetActiveSocialAccount

Returns the account a player is signed in to.

lua---@param src integer
---@param app string
---@return table|nil account nil when the player is not signed in to that app
exports['fx-phone']:GetActiveSocialAccount(src, app)
lualocal account = exports['fx-phone']:GetActiveSocialAccount(source, 'pixl')
  • Same shape as GetSocialAccount, without identifier.

#SetSocialVerified

Gives an account the verified badge, or takes it away.

lua---@param app string
---@param username string
---@param verified boolean|number true: permanent. false: removed. A number: verified for that many days
---@return boolean ok false for an unknown account
exports['fx-phone']:SetSocialVerified(app, username, verified)
luaexports['fx-phone']:SetSocialVerified('chirp', 'renkaya', 30)