Update app.py
Browse files
app.py
CHANGED
@@ -93,11 +93,9 @@ async def display_stats(message: discord.Message):
|
|
93 |
|
94 |
|
95 |
async def load_space(guild: discord.Guild, message: discord.Message, content: str):
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
.get("host")
|
100 |
-
)
|
101 |
if iframe_url is None:
|
102 |
return await message.channel.send(
|
103 |
f"Space: {content} not found. If you'd like to make a prediction, enclose the inputs in quotation marks."
|
|
|
93 |
|
94 |
|
95 |
async def load_space(guild: discord.Guild, message: discord.Message, content: str):
|
96 |
+
response = requests.get(f"https://huggingface.co/api/spaces/{content}/host")
|
97 |
+
print(response.json())
|
98 |
+
iframe_url = response.json().get("host")
|
|
|
|
|
99 |
if iframe_url is None:
|
100 |
return await message.channel.send(
|
101 |
f"Space: {content} not found. If you'd like to make a prediction, enclose the inputs in quotation marks."
|