📘
BetterChat V3
  • Introduction
  • Server
    • Getting started
    • Speaker
    • Channel
    • Player attributes
  • Client
    • Commands
    • API
    • Autofills
Powered by GitBook
On this page
  • :getTopbarButton()
  • :getSetting(<container>,<settingName>)
  • :systemMessage(<text>)
  • :getQuickChatSlot(<number>)
  • :saveToQuickChatSlot(<number>,<string>)
  1. Client

API

PreviousCommandsNextAutofills

Last updated 3 years ago

The client has a work-in-progress API that I've just begun creating, and here's the documentation for the existing functions.

To make a plugin for the client, simply insert a return function into a module and place the module in the 'Plugins' folder.

return function(api)
    --> client api :)
end

:getTopbarButton()

This method returns the Topbar+ button used to open the settings menu.

api:getTopbarButton():setRight()

:getSetting(<container>,<settingName>)

UI
BubbleChat

Resizable <boolean>

Enabled <boolean>

Roundness <number/slider> (0-12)

AnimationStyle <string> (Enum.EasingStyle list)

TextSize <number/slider> (10-20)

FadeoutTime <number/slider> (3-25)

Font <string> (Enum.Font list)

For developers who want to create their own settings UI, they can use this method to access the values and change them accordingly'.

A boolean value setting would look like this:

{
    value = true,
    type = "boolean",
    changed = <signal> --> (:Connect)
    set = <function>
}

:set(<boolean>)

Call the :set() function with the boolean value to update it's state.

Example:

local setting = api:getSetting("UI","Resizable")
setting.changed:Connect(function(new)
    print(new)
end)
setting:set(false) --> disable resizable UI

A string value setting would look like this:

{
    value = "Text",
    type = "string",
    options = {...},
    changed = <signal>,
    set = <function>
}

:set(<string>)

Call the :set() function with one of the values from the options table to update the setting.

local setting = api:getSetting("BubbleChat","Font")
local randomFont = setting.options[math.random(1,#setting.options)]
setting:set(randomFont)

A number value setting would look like this:

{
    value = 16,
    limits = {10,20},
    type = "number",
    changed = <signal>,
    set = <function>
}

:set(<number>)

Call the :set() function with a number within the limits to update the value.

local setting = api:getSetting("UI","TextSize")
setting:set(16) --> set txt size to 16

:systemMessage(<text>)

This method displays a system message in the chat with the specified text.

api:systemMessage("What?")

:getQuickChatSlot(<number>)

If quick chat is enabled, you can pass a number from 1-20 to get the text in that specified quick chat slot.

api:getQuickChatSlot(1) --> nil/string

:saveToQuickChatSlot(<number>,<string>)

If quick chat is enabled, you can pass both a number and the text you want to save to the specified quick chat slot to be used later.

api:saveToQuickChatSlot(1,"hi")
-- now saying /1 in chat will send 'hi'

(docs here)