Skip to content

Commit

Permalink
fixed question has_answer field
Browse files Browse the repository at this point in the history
  • Loading branch information
GnarLito committed Nov 24, 2021
1 parent 5b10780 commit d22554b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="tryhackme.py",
version="1.0.0",
version="1.2.1",
author="gnarlito",
author_email="gnarlito35@gmail.com",
description="THM public API wrapper",
Expand Down
2 changes: 1 addition & 1 deletion tryhackme/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def _from_data(self, data):
self.correct = data.get("correct", False)
self.attempts = data.get("attempts", 0)
self.submission = data.get("submission", "")
self.has_answer = data.get("noAnswer", False)
self.has_answer = not data.get("noAnswer", False)

10 changes: 10 additions & 0 deletions tryhackme/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ def _clear_client(self):
self._message_groups = weakref.WeakValueDictionary()
self._team = None

def _clear_all(self):
self._rooms = weakref.WeakValueDictionary()
self._paths = weakref.WeakValueDictionary()
self._modules = weakref.WeakValueDictionary()
self._users = weakref.WeakValueDictionary()
self._message_groups = weakref.WeakValueDictionary()
self._badges = weakref.WeakValueDictionary()
self._series = weakref.WeakValueDictionary()
self._networks = weakref.WeakValueDictionary()

def get_client_user(self):
return self.user

Expand Down

0 comments on commit d22554b

Please sign in to comment.