WIP: ID returns

This commit is contained in:
Profitroll 2023-03-16 12:58:57 +01:00
parent be8f0262d0
commit 62e0a4986c

View File

@ -96,7 +96,7 @@ async def random_pic(token: Union[str, None] = None) -> Tuple[str, str]:
async def upload_pic(
filepath: str, allow_duplicates: bool = False, token: Union[str, None] = None
) -> Tuple[bool, list]:
) -> Tuple[bool, list, str]:
token = await authorize() if token is None else token
try:
pic_name = path.basename(filepath)
@ -135,10 +135,10 @@ async def upload_pic(
duplicates.append(
f'`{duplicate["id"]}`:\n{configGet("address_external", "posting", "api")}/token/photo/{(await response.json())["access_token"]}?id={index}'
)
return True, duplicates
return True, duplicates, (await response.json())["id"]
except Exception as exp:
print_exc()
return False, []
return False, [], ""
async def find_pic(