tripleS-Dev
commited on
Commit
•
14ea209
1
Parent(s):
1c1f3a2
start
Browse files- bot.py +7 -3
- cosmo.py +2 -1
- funtion.py +1 -1
- requirements.txt +0 -0
bot.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import discord
|
2 |
from discord.ext import commands
|
3 |
from discord import app_commands
|
@@ -45,7 +47,9 @@ async def collect(interaction: discord.Interaction, name: str, count: Optional[i
|
|
45 |
|
46 |
|
47 |
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
import discord
|
4 |
from discord.ext import commands
|
5 |
from discord import app_commands
|
|
|
47 |
|
48 |
|
49 |
|
50 |
+
toker = os.getenv['super_cosmo']
|
51 |
|
52 |
+
if toker:
|
53 |
+
client.run(toker)
|
54 |
+
else:
|
55 |
+
client.run('MTIzMzY5MzE1NzU2NTM5OTA5MA.Guap9W.MEtVVH4k2__M9pocPl_5CBw3mPP54a8y_4vCQs')
|
cosmo.py
CHANGED
@@ -37,13 +37,14 @@ def download_img(token_id, folder_name):
|
|
37 |
if 'objekt' in response_json and 'thumbnailImage' in response_json['objekt']:
|
38 |
thumbnail_url = response_json['objekt']['thumbnailImage']
|
39 |
name = response_json.get('name', 'Unknown') # Use 'Unknown' if 'name' key is not found
|
|
|
40 |
|
41 |
# Fetching the thumbnail image
|
42 |
img = fetch_image_with_retries(thumbnail_url)
|
43 |
|
44 |
# Adding metadata
|
45 |
meta = PngImagePlugin.PngInfo()
|
46 |
-
meta.add_text("name", name)
|
47 |
|
48 |
# Saving the image with tokenId as filename
|
49 |
filename = f"./{folder_name}/{token_id}.png"
|
|
|
37 |
if 'objekt' in response_json and 'thumbnailImage' in response_json['objekt']:
|
38 |
thumbnail_url = response_json['objekt']['thumbnailImage']
|
39 |
name = response_json.get('name', 'Unknown') # Use 'Unknown' if 'name' key is not found
|
40 |
+
class_nft = response_json['objekt']['class'] # Use 'Unknown' if 'name' key is not found
|
41 |
|
42 |
# Fetching the thumbnail image
|
43 |
img = fetch_image_with_retries(thumbnail_url)
|
44 |
|
45 |
# Adding metadata
|
46 |
meta = PngImagePlugin.PngInfo()
|
47 |
+
meta.add_text("name", f"{name} {class_nft}")
|
48 |
|
49 |
# Saving the image with tokenId as filename
|
50 |
filename = f"./{folder_name}/{token_id}.png"
|
funtion.py
CHANGED
@@ -23,7 +23,7 @@ def download(folder_name, Range=9):
|
|
23 |
|
24 |
def download_sort(folder_name, Range=9, txt=None):
|
25 |
adress = cosmo2hex.adress_search(folder_name)
|
26 |
-
token_ids = get_token.get_nfts(adress,
|
27 |
|
28 |
if os.path.exists(folder_name):
|
29 |
shutil.rmtree(folder_name)
|
|
|
23 |
|
24 |
def download_sort(folder_name, Range=9, txt=None):
|
25 |
adress = cosmo2hex.adress_search(folder_name)
|
26 |
+
token_ids = get_token.get_nfts(adress, 10000)
|
27 |
|
28 |
if os.path.exists(folder_name):
|
29 |
shutil.rmtree(folder_name)
|
requirements.txt
ADDED
Binary file (1.57 kB). View file
|
|