summaryrefslogtreecommitdiff
path: root/config/assets.py
diff options
context:
space:
mode:
authorJoshua Liu <joshua.liu@sourceobby.com>2025-11-30 11:11:38 -0500
committerJoshua Liu <joshua.liu@sourceobby.com>2025-11-30 11:13:48 -0500
commit74c3967b61f5f6dc1136af3d3d74571d47423b88 (patch)
tree3634e598e4088931eeaacb74b9b04cd36371afce /config/assets.py
parent2f07ef45f1954ae7b558a92e669d7a7581984533 (diff)
feat: created ImageManager class and implemented get_image_fp
Diffstat (limited to 'config/assets.py')
-rw-r--r--config/assets.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/config/assets.py b/config/assets.py
new file mode 100644
index 0000000..15568ce
--- /dev/null
+++ b/config/assets.py
@@ -0,0 +1,14 @@
+import discord
+
+class ImageManager:
+ def __init__(self):
+ pass
+
+ def get_image_fp(self, img_name = "") -> discord.File | None:
+ res = None
+ try:
+ image_handler = open(f"config/{img_name}.jpg", "rb")
+ res = discord.File(fp=image_handler, filename=img_name)
+ except FileNotFoundError:
+ print("Image not found in assets directory")
+ return res \ No newline at end of file