From 6a5401a79149a27a715dd8215b58370a91947033 Mon Sep 17 00:00:00 2001 From: Magic <82341152+MagicTheDev@users.noreply.github.com> Date: Mon, 29 Jan 2024 03:13:18 -0600 Subject: [PATCH] ClashKing v4 --- utility/cdn.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/utility/cdn.py b/utility/cdn.py index a6d36336..a9237547 100644 --- a/utility/cdn.py +++ b/utility/cdn.py @@ -1,14 +1,13 @@ import disnake import aiohttp -import os -from dotenv import load_dotenv from datetime import datetime -load_dotenv() +from classes.config import Config +config = Config() async def upload_to_cdn(picture: disnake.Attachment): headers = { "content-type": "application/octet-stream", - "AccessKey": os.getenv("BUNNY_ACCESS") + "AccessKey": config.bunny_api_token } payload = await picture.read() async with aiohttp.ClientSession() as session: @@ -20,7 +19,7 @@ async def upload_to_cdn(picture: disnake.Attachment): async def general_upload_to_cdn(bytes_, id): headers = { "content-type": "application/octet-stream", - "AccessKey": os.getenv("BUNNY_ACCESS") + "AccessKey": config.bunny_api_token } payload = bytes_ async with aiohttp.ClientSession() as session: @@ -32,7 +31,7 @@ async def general_upload_to_cdn(bytes_, id): async def upload_html_to_cdn(bytes_, id): headers = { "content-type": "application/octet-stream", - "AccessKey": os.getenv("BUNNY_ACCESS") + "AccessKey": config.bunny_api_token } payload = bytes_ async with aiohttp.ClientSession() as session: