Add function to get a submission

I shouldn't have to use the Submission class to do anything outside of the library.
This commit is contained in:
Thomas Wade 2020-04-22 03:59:45 +09:30
parent c72ff23a4a
commit a70f181673
2 changed files with 9 additions and 1 deletions

View File

@ -521,3 +521,11 @@ class FAAPI:
:return: User that this instance is logged in as.
"""
return self.get_user(self.username) if self.logged_in else None
def get_submission(self, id: int) -> Submission:
"""
Gets a submission by its numeric ID.
:param id: Submission ID
:return: Submission
"""
return Submission.new_or_cached(self, id)

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='FAAPI',
version='0.3.1',
version='0.4.0',
packages=find_packages(),
url='https://tem.party/gitea/tom/FAAPI',
license='WTFPL',