hytopia 0.10.13 → 0.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/server.chatmanager.handlecommand.md +72 -0
- package/docs/server.chatmanager.md +14 -0
- package/package.json +1 -1
- package/server.api.json +65 -0
- package/server.d.ts +7 -0
- package/server.mjs +3 -3
@@ -0,0 +1,72 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [ChatManager](./server.chatmanager.md) > [handleCommand](./server.chatmanager.handlecommand.md)
|
4
|
+
|
5
|
+
## ChatManager.handleCommand() method
|
6
|
+
|
7
|
+
Handle a command if it exists.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
handleCommand(player: Player, message: string): boolean;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
player
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
[Player](./server.player.md)
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The player that sent the command.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
message
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
string
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The full message.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
</tbody></table>
|
66
|
+
|
67
|
+
**Returns:**
|
68
|
+
|
69
|
+
boolean
|
70
|
+
|
71
|
+
True if a command was handled, false otherwise.
|
72
|
+
|
@@ -60,6 +60,20 @@ Description
|
|
60
60
|
</th></tr></thead>
|
61
61
|
<tbody><tr><td>
|
62
62
|
|
63
|
+
[handleCommand(player, message)](./server.chatmanager.handlecommand.md)
|
64
|
+
|
65
|
+
|
66
|
+
</td><td>
|
67
|
+
|
68
|
+
|
69
|
+
</td><td>
|
70
|
+
|
71
|
+
Handle a command if it exists.
|
72
|
+
|
73
|
+
|
74
|
+
</td></tr>
|
75
|
+
<tr><td>
|
76
|
+
|
63
77
|
[registerCommand(command, callback)](./server.chatmanager.registercommand.md)
|
64
78
|
|
65
79
|
|
package/package.json
CHANGED
package/server.api.json
CHANGED
@@ -6301,6 +6301,71 @@
|
|
6301
6301
|
"name": "ChatManager",
|
6302
6302
|
"preserveMemberOrder": false,
|
6303
6303
|
"members": [
|
6304
|
+
{
|
6305
|
+
"kind": "Method",
|
6306
|
+
"canonicalReference": "server!ChatManager#handleCommand:member(1)",
|
6307
|
+
"docComment": "/**\n * Handle a command if it exists.\n *\n * @param player - The player that sent the command.\n *\n * @param message - The full message.\n *\n * @returns True if a command was handled, false otherwise.\n */\n",
|
6308
|
+
"excerptTokens": [
|
6309
|
+
{
|
6310
|
+
"kind": "Content",
|
6311
|
+
"text": "handleCommand(player: "
|
6312
|
+
},
|
6313
|
+
{
|
6314
|
+
"kind": "Reference",
|
6315
|
+
"text": "Player",
|
6316
|
+
"canonicalReference": "server!Player:class"
|
6317
|
+
},
|
6318
|
+
{
|
6319
|
+
"kind": "Content",
|
6320
|
+
"text": ", message: "
|
6321
|
+
},
|
6322
|
+
{
|
6323
|
+
"kind": "Content",
|
6324
|
+
"text": "string"
|
6325
|
+
},
|
6326
|
+
{
|
6327
|
+
"kind": "Content",
|
6328
|
+
"text": "): "
|
6329
|
+
},
|
6330
|
+
{
|
6331
|
+
"kind": "Content",
|
6332
|
+
"text": "boolean"
|
6333
|
+
},
|
6334
|
+
{
|
6335
|
+
"kind": "Content",
|
6336
|
+
"text": ";"
|
6337
|
+
}
|
6338
|
+
],
|
6339
|
+
"isStatic": false,
|
6340
|
+
"returnTypeTokenRange": {
|
6341
|
+
"startIndex": 5,
|
6342
|
+
"endIndex": 6
|
6343
|
+
},
|
6344
|
+
"releaseTag": "Public",
|
6345
|
+
"isProtected": false,
|
6346
|
+
"overloadIndex": 1,
|
6347
|
+
"parameters": [
|
6348
|
+
{
|
6349
|
+
"parameterName": "player",
|
6350
|
+
"parameterTypeTokenRange": {
|
6351
|
+
"startIndex": 1,
|
6352
|
+
"endIndex": 2
|
6353
|
+
},
|
6354
|
+
"isOptional": false
|
6355
|
+
},
|
6356
|
+
{
|
6357
|
+
"parameterName": "message",
|
6358
|
+
"parameterTypeTokenRange": {
|
6359
|
+
"startIndex": 3,
|
6360
|
+
"endIndex": 4
|
6361
|
+
},
|
6362
|
+
"isOptional": false
|
6363
|
+
}
|
6364
|
+
],
|
6365
|
+
"isOptional": false,
|
6366
|
+
"isAbstract": false,
|
6367
|
+
"name": "handleCommand"
|
6368
|
+
},
|
6304
6369
|
{
|
6305
6370
|
"kind": "Method",
|
6306
6371
|
"canonicalReference": "server!ChatManager#registerCommand:member(1)",
|
package/server.d.ts
CHANGED
@@ -836,6 +836,13 @@ export declare class ChatManager extends EventRouter {
|
|
836
836
|
* ```
|
837
837
|
*/
|
838
838
|
sendBroadcastMessage(message: string, color?: string): void;
|
839
|
+
/**
|
840
|
+
* Handle a command if it exists.
|
841
|
+
* @param player - The player that sent the command.
|
842
|
+
* @param message - The full message.
|
843
|
+
* @returns True if a command was handled, false otherwise.
|
844
|
+
*/
|
845
|
+
handleCommand(player: Player, message: string): boolean;
|
839
846
|
/**
|
840
847
|
* Send a system message to a specific player, only visible to them.
|
841
848
|
* @param player - The player to send the message to.
|