summaryrefslogtreecommitdiff
path: root/config/assets.py
blob: 15568cebafcb31b0b7e806ef155a8f35dcf00f18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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