dev #19
@ -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(
|
||||
|
Reference in New Issue
Block a user