Skip to content

Commit

Permalink
ClashKing v4
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Jan 29, 2024
1 parent 9bb88a4 commit 6a5401a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions utility/cdn.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 6a5401a

Please sign in to comment.