4.2 KiB
4.2 KiB
Chat3 API
Main API
chat3.colorize(name, color, msg)
- Checks protocol of
name
and if recent enough returns the colourizedmsg
- This does not send the message to the player, but just returns the message.
name
: Name of player to whom the colorized message is to be sentcolor
: Hex-code or color name (string)msg
: Message to colorize
chat3.send(name, msg, prefix, source)
- Simulate a message being sent to all players
name
: Sender player namemsg
: Message to sendprefix
: An optional string to prefix the colourized message and usernamesource
: Used by ranks to allow compatibility between ranks and chat3
Ignore API
chat3.ignore.get(name)
- Returns table of ignored players (e.g.
{ignoring = {name1 = true, ...}, ignored_by = {name2 = true, ...}}
)name
: Player username
chat3.ignore.set(name, list)
- Set a player's ignore list
name
: Player usernamelist
: Table of names (e.g. (e.g.{ignoring = {name1 = true, ...}, ignored_by = {name2 = true, ...}}
)
chat3.ignore.add_name(name, ignore)
- Returns
success
ifignore
was added toname
'signoring
list andname
- to
ignore
'signored_by
list name
: Name of player to whose ignore listignore
should be addedignore
: Player username to ignore
chat3.ignore.remove_name(name, unignore)
- Returns
success
ifignore
was removed fromname
'signoring
list and name
fromignore
'signored_by
list
chat3.ignore.clear(name)
- Returns
success
ifname
's ignore list was cleared - This should be used over
chat3.ignore.set(name, nil)
as it also clears ignored_by
lists and notifies no longer ignored players.name
: Name of player whose ignore list should be cleared
chat3.ignore.can(name, check)
- Returns
true
if the player can be ignored - If the player cannot be ignored they will be removed from the ignore list of
- the player ignoring them.
name
: Name of player whose ignore list is to be checkedcheck
: Player username to check if ignored
chat3.ignore.is(name, check)
- Returns
true
if the player is being ignored name
: Name of player whose ignore list is to be checkedtarget
: Player Object of player to check the ignore list of
chat3.ignore.add(name, ignore)
- Returns
success, message
after attempting to ignore a player - Verbose, chat-friendly version of
chat3.ignore.add_name
name
: Name of player to whose ignore listignore
should be addedignore
: Player username to attempt to ignore
chat3.ignore.remove(name, unignore)
- Returns
success, message
after attempting to remove a player from another's - ignore list.
- Verbose, chat-friendly version of
chat3.ignore.remove_name
name
: Name of player from whose ignore listunignore
should be removedplayer
: Player username to attempt to unignore
chat3.ignore.check(name, check)
- Returns
result, message
after attempting to find out ifcheck
is being - ignored by
name
. name
: Name of player whose ignore list should be checkedcheck
: Player username to check if being ignored
chat3.ignore.list(name, subtable)
- Returns a table containing a list of players being ignored by
name
, ornil
- if none, in a format suitable for use with
table.concat
(e.g.{name1, name2, ...}
). name
: Name of player whose ignore list should be listedsubtable
: Table to return (ignoring
orignored_by
)
Alternate Username API
chat3.alt.get(name)
- Returns table of alternate usernames (e.g.
{name1 = true, name2 = true, ...}
) name
: Player username
chat3.alt.set(name, list)
- Set a player's alternate username list
name
: Player usernamelist
: Table of alternate usernames (e.g.{name1 = true, name2 = true, ...}
)
chat3.alt.add(name, alt)
- Add an alternate username (returns
nil
if max has been reached or if the alternate username already exists) name
: Base player usernamealt
: New alternate username
chat3.alt.remove(name, alt)
- Remove an alternate username (returns
nil
if the username already does not exist) name
: Base player usernamealt
: Alternate username to remove
chat3.alt.list(name)
- Returns a table with a list of alternate usernames (suitable for
table.concat
) name
: Player username