From 86ecb3ede4d0e675c69b0e6986d4bc863838cb58 Mon Sep 17 00:00:00 2001 From: skelmis Date: Thu, 27 Aug 2020 23:44:18 +1200 Subject: [PATCH] Further document methods. --- examples/Parsers.py | 15 +++++++++++++++ examples/Player.py | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/examples/Parsers.py b/examples/Parsers.py index 99c7571..f907029 100644 --- a/examples/Parsers.py +++ b/examples/Parsers.py @@ -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) diff --git a/examples/Player.py b/examples/Player.py index a88ad7e..9febf4e 100644 --- a/examples/Player.py +++ b/examples/Player.py @@ -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):