diff options
| -rw-r--r-- | docs/api/commands.md | 10 | ||||
| -rw-r--r-- | docs/api/objects.md | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/docs/api/commands.md b/docs/api/commands.md index dc4cd6c..9483cc0 100644 --- a/docs/api/commands.md +++ b/docs/api/commands.md @@ -14,11 +14,15 @@ you must declare your commands. > ```python > def register(self, plugin_manager): > self.plugin_manager = plugin_manager -> self.plugin_manager.register_command('test', self.test) +> self.plugin_manager.register_command('test', self.test, "This is a test command", 'alias') >``` -Now if a person sends a message `!test` in the chat, the `test` method of your plugin -will run. +``register_command`` takes 4 arguments: +- Command Name (string) : This is the first argument, which tells the main command name for your command. +- Callback : This is function that will be run when a user runs your command. Structure of a command +function is shown below. +- Help text (string, optional) : This string contains what your command does, it will be displayed in ``help`` command. +- Alias (string, optional) : Helps you define an alias for your command. Useful for creating shorter command name for ease of use. # Command Function Structure diff --git a/docs/api/objects.md b/docs/api/objects.md index 7296e7a..bb0ae28 100644 --- a/docs/api/objects.md +++ b/docs/api/objects.md @@ -223,7 +223,7 @@ The `Player` class represents a connected client. It stores key information such * **`streamWriterObject`**: Object for handling network communication with the player's client. * **`is_a_bot`**: A boolean flag indicating if the player is considered a bot. Initially `True`, and is intended to be set to `False` after a successful `LOGIN` packet is processed, to differentiate real players from initial bot-like states. * **`iff`** : An inetger value which contains the last-known IFF value of the player. Intially `1`, changes with Join Requests from player. - +* **connection_closed** : A boolean flag that indicates if a player has closed connection. #### Methods ##### `set_aircraft(aircraft: Aircraft)` |
