AthenaClient.systems.messenger ​
Type Aliases ​
HistoryCallback ​
Ƭ HistoryCallback: (msgs
: MessageInfo
[]) => void
Type declaration ​
Usage
AthenaClient.systems.messenger.(msgs
): void
Parameters ​
Name | Type |
---|---|
msgs | MessageInfo [] |
Returns ​
void
Defined in ​
MessageCallback ​
Ƭ MessageCallback: (msg
: string
) => void
Type declaration ​
Usage
AthenaClient.systems.messenger.(msg
): void
Parameters ​
Name | Type |
---|---|
msg | string |
Returns ​
void
Defined in ​
MessageInfo ​
Ƭ MessageInfo: Object
Type declaration ​
Name | Type |
---|---|
msg | string |
timestamp | number |
Defined in ​
Functions ​
emit ​
Usage
AthenaClient.systems.messenger.emit(msg
): void
Emits a message to all callbacks.
Parameters ​
Name | Type |
---|---|
msg | string |
Returns ​
void
Defined in ​
client/systems/messenger.ts:43
getCommands ​
Get the commands that this client has permission for.
Returns ​
Omit
<player
<alt.Player
>, "callback"
>[]
Defined in ​
client/systems/messenger.ts:101
getHistory ​
Usage
AthenaClient.systems.messenger.getHistory(): { msg
: string
; timestamp
: number
}[]
Return current chat history. Newest message is always first element in array.
Returns ​
{ msg
: string
; timestamp
: number
}[]
Defined in ​
client/systems/messenger.ts:71
registerHistoryCallback ​
Usage
AthenaClient.systems.messenger.registerHistoryCallback(callback
): void
Register a callback that handles messages. The messages from other clients, and Athena itself will be pushed through all callbacks registered. Useful for plugin creators.
Parameters ​
Name | Type |
---|---|
callback | HistoryCallback |
Returns ​
void
Defined in ​
client/systems/messenger.ts:34
registerMessageCallback ​
Usage
AthenaClient.systems.messenger.registerMessageCallback(callback
): void
Register a callback that handles messages. The messages from other clients, and Athena itself will be pushed through all callbacks registered. Useful for plugin creators.
Parameters ​
Name | Type |
---|---|
callback | MessageCallback |
Returns ​
void
Defined in ​
client/systems/messenger.ts:23
send ​
Usage
AthenaClient.systems.messenger.send(msg
): void
Takes a message, or command and processes it from an input. Commands must start with a forward slash. Such as '/'.
Parameters ​
Name | Type |
---|---|
msg | string |
Returns ​
void
Defined in ​
client/systems/messenger.ts:81
setCommands ​
Usage
AthenaClient.systems.messenger.setCommands(_commands
): void
Populates the local command list for the client. Which can be used to
Parameters ​
Name | Type |
---|---|
_commands | Omit <MessageCommand <Player >, "callback" >[] |
Returns ​
void