diff --git a/README.md b/README.md index 6f3cee0..dec45af 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,6 @@ dead simple last.fm bot - add collage generation - fix attachment generation and upload - ~~**temporary fix**: upload and link to catbox urls~~ the asynchronous catbox library does not accept byte arrays - - **temporary fix**: construct the attachment object from scratch and upload manually(?) + - ~~**temporary fix**: construct the attachment object from scratch and upload manually(?)~~ its still broken + - **temporary fix:** use 0x0.st - **permanent fix**: fork and update nerimity library diff --git a/utils.py b/utils.py index 8c42842..08de67a 100644 --- a/utils.py +++ b/utils.py @@ -1,9 +1,10 @@ +# import io # import requests # import mimetypes import nerimity -# def construct_attachment_from_url(url: str = None): +# def construct_attachment_from_url(url: str = None) -> nerimity.Attachment | None: # if not url: return None # content = requests.get(url).content @@ -17,8 +18,22 @@ import nerimity # return attachment -def error_msg(message: str): +# def construct_attachment_from_bytes(filename: str = "file", bytes_arr: io.BytesIO = None, file_type: str = None) -> nerimity.Attachment | None: +# if not bytes_arr: return None +# if not file_type: return None + +# attachment = nerimity.Attachment() +# attachment.internal_type = nerimity.AttachmentTypes.OUTGOING + +# attachment.data = bytes_arr.read() +# attachment.data_type = file_type +# attachment.size = len(attachment.data) +# attachment.name = filename + +# return attachment + +def error_msg(message: str) -> str: return f"[#e5323b][Error] [#reset]{message}" -def good_msg(message: str): +def good_msg(message: str) -> str: return f"[#52ff54][Success] [#reset]{message}"