Spaces:
Running
Running
Remove attribute rc
Browse files- discord_bot.py +3 -3
- horde.py +1 -1
discord_bot.py
CHANGED
@@ -29,7 +29,7 @@ async def getKudos(interaction: discord.Interaction):
|
|
29 |
await interaction.response.defer()
|
30 |
async with HordeAPI.getUserDetails() as details:
|
31 |
if "kudos" not in details:
|
32 |
-
await interaction.followup.send(f'Error: {details["code"]} {details["reason"]}
|
33 |
return
|
34 |
await interaction.followup.send(f'The amount of Kudos this user has is {details["kudos"]}')
|
35 |
|
@@ -38,7 +38,7 @@ async def generateStatus(interaction: discord.Interaction, id: str):
|
|
38 |
await interaction.response.defer()
|
39 |
async with HordeAPI.generateCheck(id) as details:
|
40 |
if "kudos" not in details:
|
41 |
-
await interaction.followup.send(f'Check Error: {details["code"]} {details["reason"]}
|
42 |
return
|
43 |
if bool(details["is_possible"]) == False:
|
44 |
await interaction.followup.send("This generation is impossible.")
|
@@ -49,7 +49,7 @@ async def generateStatus(interaction: discord.Interaction, id: str):
|
|
49 |
if bool(details["done"]) == True:
|
50 |
async with HordeAPI.generateStatus(id) as generationDetail:
|
51 |
if "generations" not in generationDetail:
|
52 |
-
await interaction.followup.send(f'Status Error: {generationDetail["code"]} {generationDetail["reason"]}
|
53 |
for i in range(len(generationDetail["generations"])):
|
54 |
await interaction.followup.send(generationDetail["generations"][i]["img"])
|
55 |
return
|
|
|
29 |
await interaction.response.defer()
|
30 |
async with HordeAPI.getUserDetails() as details:
|
31 |
if "kudos" not in details:
|
32 |
+
await interaction.followup.send(f'Error: {details["code"]} {details["reason"]}')
|
33 |
return
|
34 |
await interaction.followup.send(f'The amount of Kudos this user has is {details["kudos"]}')
|
35 |
|
|
|
38 |
await interaction.response.defer()
|
39 |
async with HordeAPI.generateCheck(id) as details:
|
40 |
if "kudos" not in details:
|
41 |
+
await interaction.followup.send(f'Check Error: {details["code"]} {details["reason"]}')
|
42 |
return
|
43 |
if bool(details["is_possible"]) == False:
|
44 |
await interaction.followup.send("This generation is impossible.")
|
|
|
49 |
if bool(details["done"]) == True:
|
50 |
async with HordeAPI.generateStatus(id) as generationDetail:
|
51 |
if "generations" not in generationDetail:
|
52 |
+
await interaction.followup.send(f'Status Error: {generationDetail["code"]} {generationDetail["reason"]}')
|
53 |
for i in range(len(generationDetail["generations"])):
|
54 |
await interaction.followup.send(generationDetail["generations"][i]["img"])
|
55 |
return
|
horde.py
CHANGED
@@ -24,7 +24,7 @@ class HordeAPI:
|
|
24 |
else:
|
25 |
return {
|
26 |
"code": response.status_code,
|
27 |
-
"reason": response.text
|
28 |
}
|
29 |
|
30 |
class APIContextManager:
|
|
|
24 |
else:
|
25 |
return {
|
26 |
"code": response.status_code,
|
27 |
+
"reason": response.text
|
28 |
}
|
29 |
|
30 |
class APIContextManager:
|