aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--snekbox/snekio.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/snekbox/snekio.py b/snekbox/snekio.py
index b5bd5a1..45ebc61 100644
--- a/snekbox/snekio.py
+++ b/snekbox/snekio.py
@@ -43,6 +43,11 @@ class FileAttachment:
path: str
content: bytes
+ def __repr__(self) -> str:
+ path = f"{self.path[:30]}..." if len(self.path) > 30 else self.path
+ content = f"{self.content[:15]}..." if len(self.content) > 15 else self.content
+ return f"{self.__class__.__name__}(path={path!r}, content={content!r})"
+
@classmethod
def from_dict(cls, data: dict[str, str]) -> FileAttachment:
"""