High Scripts

Documentation

Server

Server export functions / types

General

getPlayerByPhone

Gets the player object that follows the bridge getPlayer structure.

Arguments

NameTypeDescription
phoneNumberstringPhone number

Example

server.lua
local player = exports['high-phone']:getPlayerByPhone('12345')
print(player.id, player.identifier)

getPlayerPhone

Gets player's phone object by their ID

Arguments

NameTypeDescription
idnumberPlayer ID

Example

server.lua
local phone = exports['high-phone']:getPlayerPhone(1)
print(phone.number, phone.id, phone.settings)

getPlayerPhoneNumber

Gets player's phone number by their ID

Arguments

NameTypeDescription
idnumberPlayer ID

Example

server.lua
local phoneNumber = exports['high-phone']:getPlayerPhoneNumber(1)
print(phoneNumber)

sendNotification

Send a notification to a phone or a player

Arguments

NameTypeDescription
receiverstringPlayer ID or phone number
dataNotificationDataNotification data

Example

server.lua
exports['high-phone']:sendNotification(-1, {
    application = { name = 'twizzler' },
    title = 'Hello',
    content = 'World!',
    duration = 5000
})

Mail

sendMail

Send mail from either the system or a player. To use HTML, action buttons, etc. you have to send a mail from the system by using one of the reservedUsers addresses you've configured in the mail app configuration.

Arguments

NameTypeDescription
dataMailDataMail data

Example

server.lua
exports['high-phone']:sendMail({
    sender = '12345',
    recipients = { '[email protected]', '[email protected]' },
    subject = 'Hello World',
    content = 'Hello Mars',
    attachments = {
        { 
            type = 'media', 
            content = {
                type = 'image', -- or 'video'
                url = 'https://i.imgur.com/6AnLddq.png'
            } 
        }
    }
})

getPlayerMailAccount

Get a player's mail account data

Arguments

NameTypeDescription
sourcenumberPlayer's ID

Example

server.lua
local account = exports['high-phone']:getPlayerMailAccount(1)
print(account?.address)

getOfflinePlayerMailAccount

Get an offline player's mail account data by player's identifier

Arguments

NameTypeDescription
identifierstringPlayer's identifier

Example

server.lua
local account = exports['high-phone']:getOfflinePlayerMailAccount('char1:2gtp1d6c57d7989ba1209e2c6gc9002f4872b856')
print(account?.address)

Messages

sendMessage

Send a message to a number from a number

Arguments

NameTypeDescription
dataMessageDataMessage data

Example

server.lua
exports['high-phone']:sendMessage({
    sender = '12345',
    recipient = '123456',
    content = 'Hello World',
    attachments = {
        { 
            type = 'media', 
            content = {
                type = 'image', -- or 'video'
                url = 'https://i.imgur.com/6AnLddq.png'
            }
        }
    }
})

Types

MessageData

NameTypeDescription
senderstringSender phone number
recipientstringRecipient's phone number
contentstringMessage content
attachmentsAttachment[]Attachments

MailData

NameTypeDescription
senderstringSender phone number
recipientsstring | string[]Recipient mail addresses
subjectstringMail subject
contentstringMail content
attachmentsAttachment[]Attachments

Last updated on

On this page