aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ionite <[email protected]>2023-02-18 18:25:07 -0500
committerGravatar Ionite <[email protected]>2023-02-18 18:25:07 -0500
commit07ba33781352892a4e91ce0cea713e45fa5bc541 (patch)
tree9d1c4c64356f0bb82eae546955ace4307d5492c9
parentIntroduce variable for max output lines and chars (diff)
Add name property for FileAttachment
-rw-r--r--bot/exts/utils/snekbox/_io.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/utils/snekbox/_io.py b/bot/exts/utils/snekbox/_io.py
index 8f704705f..404681936 100644
--- a/bot/exts/utils/snekbox/_io.py
+++ b/bot/exts/utils/snekbox/_io.py
@@ -66,6 +66,11 @@ class FileAttachment:
"""Return the file suffix."""
return Path(self.path).suffix
+ @property
+ def name(self) -> str:
+ """Return the file name."""
+ return Path(self.path).name
+
@classmethod
def from_dict(cls, data: dict, size_limit: int = FILE_SIZE_LIMIT) -> FileAttachment:
"""Create a FileAttachment from a dict response."""