update references to codey.lol -> codey.horse [new domain]

This commit is contained in:
2026-02-21 07:59:40 -05:00
parent 64edcc7342
commit 31366d8df7
6 changed files with 16 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ import aiosqlite as sqlite3
import logging
import textwrap
import regex
import aiohttp
import requests
import discord
from disc_havoc import Havoc
@@ -739,9 +740,15 @@ class Meme(commands.Cog):
unique_memes: list = []
for item in message.attachments:
if item.url and len(item.url) >= 20:
image: io.BytesIO = io.BytesIO(
requests.get(item.url, stream=True, timeout=20).raw.read()
)
try:
async with ClientSession() as dl_session:
async with dl_session.get(item.url, timeout=aiohttp.ClientTimeout(total=20)) as resp:
if resp.status != 200:
continue
image_data = await resp.read()
except Exception:
continue
image: io.BytesIO = io.BytesIO(image_data)
dupe_check = await self.dupe_check(Image.open(image))
if dupe_check:
channel = message.channel