diff options
| author | troido <troido@protonmail.com> | 2020-04-23 14:27:11 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-23 14:27:11 +0200 |
| commit | 693bdddc2123a378813c1509d43f0046ca4c1a35 (patch) | |
| tree | cff7890d1e42b78d0b53c14ae8320acb420b052f | |
| parent | f7f8f1ee8fd9ed6c4fc6ca040bb86c5e9039ae89 (diff) | |
also accept messagemessages with connect as type as connectedmessages
| -rw-r--r-- | asciifarmclient/main.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/asciifarmclient/main.py b/asciifarmclient/main.py index 09c9b13..e8cd793 100644 --- a/asciifarmclient/main.py +++ b/asciifarmclient/main.py @@ -79,6 +79,8 @@ def introduce(connection, name): if isinstance(response, messages.ConnectedMessage): print("connection successful") return True + if isinstance(response, messages.MessageMessage): + return response.type == "connect" if isinstance(response, messages.ErrorMessage): if response.errType == "registered": print("'{}' is a registered name. Enter password to login, or restart the client with the -n <name> option to choose a different name".format(name)) |
