diff options
| author | troido <troido@protonmail.com> | 2020-04-22 12:06:17 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-22 12:06:17 +0200 |
| commit | 550f9b7b4cbf7ddacc88c2762893d8860566bfdf (patch) | |
| tree | 6ced0b808ccd902fd85a3037fbcc9a87b7da7d0e /asciifarmclient | |
| parent | 311a6f1b412c63e56740ab770a31534c3d7ce3f9 (diff) | |
show options list specially
Diffstat (limited to 'asciifarmclient')
| -rw-r--r-- | asciifarmclient/gameclient.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/asciifarmclient/gameclient.py b/asciifarmclient/gameclient.py index 5f61c36..b78a693 100644 --- a/asciifarmclient/gameclient.py +++ b/asciifarmclient/gameclient.py @@ -132,8 +132,18 @@ class Client: text, type = msg[1:3] self.log(text, type) if msgType == "messages": - for type, text in msg[1]: - self.log(text, type) + for message in msg[1]: + type = message[0] + text = message[1] + arg = None + if len(message) > 2: + arg = message[2] + if type == "options": + self.log(arg["description"]) + for (command, description) in arg["options"]: + self.log("/q {:<24} - {}".format(command, description)) + else: + self.log(text, type) if msgType == "options": if msg[1] != None: description, options = msg[1] |
