Further document methods.

This commit is contained in:
skelmis 2020-08-27 23:44:18 +12:00
parent 509ee4b842
commit 86ecb3ede4
2 changed files with 17 additions and 1 deletions

View File

@ -15,6 +15,21 @@ DefaultParser - Tested on mc-central, should work decent globally
def DefaultParser(data):
"""The default Player chat packet parser, designed to make chat human readable.
Parameters
----------
data : Chat Packet
The chat packet to be parsed.
Returns
-------
message : str
The chat message in human readable form
False : bool
If the parser encounters an error during parsing
"""
try:
# Convert to valid python dict
data = json.loads(data)

View File

@ -22,7 +22,8 @@ class Player:
--------
This class explicitly expects a username & password, then expects to
be able to connect to a server in online mode.
If you wish to add different functionality please
If you wish to add different functionality please view the example
headless client `start.py` for how to implement it.
"""
def __init__(self, username, password, *, admins=None):