SERVER EXPORTS

Darkchat Conversation Structure
{
  "id": 1,
  "name": "Heist Planning",
  "appName": "darkchat",
  "createdBy": 5,
  "joinCode": "X9Z2A1",
  "createdAt": 1678900000,
  "updatedAt": 1678900000,
  "recipients": [],
  "messages": [],
  "isItRead": true
}

Create Conversation (By Source)

Creates a new Darkchat conversation for a player using their Server ID (Source). You can optionally specify a join code.

local result = exports["17mov_Phone"]:Darkchat_CreateConversationBySrc(src, name, joinCode)

Returns:

  • table: { success: boolean, newConv?: DarkchatConversation }

Argument
Type
Optional
Explanation

src

number

โŒ

The player's server ID (source).

name

string

โŒ

The name of the conversation.

joinCode

string

โœ…

Code to join conversation. If not provided, it will be generated automatically.

Create Conversation (By Number)

Creates a new Darkchat conversation for a player using their phone number.

local result = exports["17mov_Phone"]:Darkchat_CreateConversationByNumber(number, name, joinCode)

Returns:

  • table: { success: boolean, newConv?: DarkchatConversation }

Argument
Type
Optional
Explanation

number

number

โŒ

The player's phone number.

name

string

โŒ

The name of the conversation.

joinCode

string

โœ…

Code to join conversation. If not provided, it will be generated automatically.

Add To Conversation (By Source)

Adds a player to an existing Darkchat conversation using their Server ID (Source).

local success = exports["17mov_Phone"]:Darkchat_AddToConversationBySrc(src, conversationId)

Returns:

  • boolean: true if the user was successfully added.

Argument
Type
Optional
Explanation

src

number

โŒ

The player's server ID (source).

conversationId

number

โŒ

ID of the conversation to add the user to.

Add To Conversation (By Number)

Adds a player to an existing Darkchat conversation using their phone number.

local success = exports["17mov_Phone"]:Darkchat_AddToConversationByNumber(number, conversationId)

Returns:

  • boolean: true if the user was successfully added.

Argument
Type
Optional
Explanation

number

number

โŒ

The player's phone number.

conversationId

number

โŒ

ID of the conversation to add the user to.

Remove From Conversation (By Source)

Removes a player from a Darkchat conversation using their Server ID (Source).

local success = exports["17mov_Phone"]:Darkchat_RemoveFromConversationBySrc(src, conversationId, isSelf)

Returns:

  • boolean: true if the user was successfully removed.

Argument
Type
Optional
Explanation

src

number

โŒ

The player's server ID (source).

conversationId

number

โŒ

ID of the conversation to remove the user from.

isSelf

boolean

โœ…

If true, the notification says "You left...". If false (or nil), it says "Owner kicked you...".

Remove From Conversation (By Number)

Removes a player from a Darkchat conversation using their phone number.

local success = exports["17mov_Phone"]:Darkchat_RemoveFromConversationByNumber(number, conversationId, isSelf)

Returns:

  • boolean: true if the user was successfully removed.

Argument
Type
Optional
Explanation

number

number

โŒ

The player's phone number.

conversationId

number

โŒ

ID of the conversation to remove the user from.

isSelf

boolean

โœ…

If true, the notification says "You left...". If false (or nil), it says "Owner kicked you...".

Last updated