summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Liu <joshua.liu@sourceobby.com>2025-11-30 11:29:23 -0500
committerJoshua Liu <joshua.liu@sourceobby.com>2025-11-30 11:29:23 -0500
commit476fddb02549bdd0bf3cd00060c120b3d923db9e (patch)
tree555e600cc3de4edf30b0faf58d31e6ebf3e4b856
parent74c3967b61f5f6dc1136af3d3d74571d47423b88 (diff)
feat: fixed a bug in assets.py and implemented the imagemanager in bigresult.py
-rw-r--r--bigresult.py5
-rw-r--r--config/assets.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/bigresult.py b/bigresult.py
index 7b59a75..48b5c6b 100644
--- a/bigresult.py
+++ b/bigresult.py
@@ -7,6 +7,8 @@ import time
from functools import partial, wraps
# from commands.funny import BigCommands
import re
+import config.assets
+from config.assets import ImageManager
ANGGY = re.compile(r'.*((are)|(is))(( so)|( really))? mad.*')
ANGGY1 = re.compile(r'.*you are(( so)|( really))? mad.*')
@@ -26,6 +28,7 @@ class BigResultPlus(commands.Bot):
"ivotedfor": BigResultPlus.voot,
"xyr0m": BigResultPlus.xyr0m
}
+ self.Imagemanager = ImageManager()
# intents = discord.Intents.all()
# self.client = commands.Bot(intents=intents, command_prefix="!") # This represents our connection with Discord
@@ -34,7 +37,7 @@ class BigResultPlus(commands.Bot):
super().command(name=key)(wraps(self.COMMANDS[key])(partial(self.COMMANDS[key], self)))
async def xyr0m(self, ctx):
- await ctx.reply("RAID INITIATED BY XYR0M\nhttps://discord.gg/cocksuckersRus\nI am extremely homosexual")
+ await ctx.reply("RAID INITIATED BY XYR0M\nhttps://discord.gg/cocksuckersRus\nI am extremely homosexual", file=self.Imagemanager.get_image_fp("XYR0M"))
pass
diff --git a/config/assets.py b/config/assets.py
index 15568ce..d89fc48 100644
--- a/config/assets.py
+++ b/config/assets.py
@@ -7,8 +7,8 @@ class ImageManager:
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)
+ image_handler = open(f"assets/{img_name}.jpg", "rb")
+ res = discord.File(fp=image_handler, filename=f"{img_name}.jpg")
except FileNotFoundError:
print("Image not found in assets directory")
return res \ No newline at end of file